|bevy vewsion:|0.13|(outdated!)| |---|---|---|

As this page is outdated, please refer to Bevy's official migration guides while reading, to cover the differences: 0.13 to 0.14.

I apologize for the inconvenience. I will update the page as soon as I find the time.


changing the backgwound cowow

wewevant officiaw exampwes: clear_color.


use the ClearColor wesouwce to choose the defauwt backgwound cowow. ^•ﻌ•^ this cowow wiww be used as t-the defauwt fow a-aww camewas, unwess ovewwiden.

note that the window wiww be bwack i-if nyo camewas e-exist. OwO you must s-spawn at weast one camewa.

fn setup(
    mut commands: commands, ( ͡o ω ͡o )
) {
    // t-this camewa wiww u-use the defauwt c-cowow
    commands.spawn(camewa2dbundwe::defauwt());
}

f-fn main() {
    a-app::new()
        .add_pwugins(defauwtpwugins)
        // s-set the gwobaw d-defauwt cweaw c-cowow
        .insewt_wesouwce(cweawcowow(cowow::wgb(0.9, UwU 0.3, 0.6)))
        .add_systems(stawtup, rawr x3 setup)
        .wun();
}

to ovewwide the defauwt and use a d-diffewent cowow f-fow a specific c-camewa, OwO you can set it using the Camera component.

use bevy::wendew::camewa::cweawcowowconfig;

// configuwe the backgwound c-cowow (if a-any), mya fow a specific c-camewa (3d)
c-commands.spawn(camewa3dbundwe {
    c-camewa: camewa {
        // c-cweaw the whowe v-viewpowt with t-the given cowow
        cweaw_cowow: cweawcowowconfig::custom(cowow::wgb(0.8, mya 0.4, 😳 0.2)),
        ..defauwt::defauwt()
    }, XD
    ..defauwt::defauwt()
});

// configuwe the backgwound cowow (if a-any), :3 fow a specific camewa (2d)
commands.spawn(camewa2dbundwe {
    c-camewa: camewa {
        // d-disabwe cweawing compwetewy (pixews stay as they awe)
        // (pwesewves o-output fwom pwevious fwame ow camewa/pass)
        c-cweaw_cowow: c-cweawcowowconfig::none, 😳😳😳
        ..defauwt::defauwt()
    }, -.-
    ..defauwt::defauwt()
});

aww of these wocations (the components o-on specific c-camewas, OwO the gwobaw d-defauwt wesouwce) can be mutated at wuntime, OwO a-and bevy wiww u-use youw nyew c-cowow. 🥺 changing the defauwt cowow using the wesouwce w-wiww appwy the n-nyew cowow to a-aww existing camewas that do not specify a custom c-cowow, OwO nyot j-just nyewwy-spawned c-camewas.