Skip to content

How do I set the window title to something other than "Bevy App"? #8632

Answered by ickshonpe
Newbytee asked this question in Q&A
Discussion options

You must be logged in to vote

Two methods:

  • The DefaultPlugins::set function:

    fn main() {
        App::new()
            .add_plugins(DefaultPlugins
                .set(WindowPlugin {
                    primary_window: Some(Window {
                        title: "something other than \"Bevy App\"".to_string(),
                        ..Default::default()
                    }),
                    ..Default::default()
                })
            )
            // .. the rest of your app
            .run();
    }
  • Query for Window from a system:

    fn set_window_title(
        mut window_query: Query<&mut Window, With<PrimaryWindow>>,
    ) {
        if let Ok(window) = window_query.get_single_mut() {
            window.title = "something other than \"Bevy App\"".to_string();
        } 
    }

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Newbytee
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
2 participants