Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to change background color of gamewindow #70

Open
indiVar0508 opened this issue Jun 15, 2024 · 1 comment
Open

how to change background color of gamewindow #70

indiVar0508 opened this issue Jun 15, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@indiVar0508
Copy link

Hi

I was trying to build some game for a deep space, wanted to know , how can i change background color of game?
currently i couldn't figure it out

    game.window_settings(Window {
         // background_color: Color::rgb( ... )
        ..Default::default()
    });

Thanks for help

@CleanCut
Copy link
Owner

CleanCut commented Jul 1, 2024

Currently rusty_engine doesn't expose a way to change the background color!

You can work around it by making a solid-color image, loading it as a sprite, scaling it big enough to fill the window, and making sure it is on the bottom layer.

The reason it isn't exposed yet is that the background part is not part of Bevy's Window struct, where we'd kind of expect it to be. The reason it isn't part of the struct is that the "background color" is actually the "clear color" for the camera that is drawing into the window (you can have any number of cameras in Bevy, but Rusty Engine only creates one). I may add functionality to set that it, though. Maybe add it as a method like game.set_background_color(...) 😄 Since I kind of want to do that anyway, I'll leave this issue open as a reminder.

@CleanCut CleanCut added enhancement New feature or request good first issue Good for newcomers labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants