Skip to content
Discussion options

You must be logged in to vote

Yes.

Bevy 0.6+

Bevy Migration Guide 0.5 to 0.6: SpriteBundle and Sprite

use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_startup_system(setup)
        .add_system(change_colors)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn_bundle(Camera2dBundle::default());
    commands.spawn_bundle(SpriteBundle {
        texture: asset_server.load("branding/icon.png"),
        ..default()
    });
}

fn change_colors(mut query: Query<&mut Sprite>) {
    for mut sprite in query.iter_mut() {
        // your color changing logic here instead:
        let a = sprite.color.a();
        sprite.color.set_a

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@gmoller
Comment options

@FelixSelter
Comment options

Answer selected by gmoller
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants