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

make UI text rendering camera driven #13697

Merged

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Jun 5, 2024

Objective

Solution

There are other parts of UI that are still PrimaryWindow dependent, if the changes here are OK I'll apply them everywhere.
I'm not a fan of the EntityHashMap here to hold the scale factors, but it seems the quick and easy fix

Testing

  • Run example multiple_windows on a screen with a scale factor different than 1, close the primary window

@mockersf mockersf added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets labels Jun 5, 2024
@rparrett
Copy link
Contributor

rparrett commented Jun 5, 2024

Side-question (this PR seems useful regardless): should Bevy promote another Window to PrimaryWindow when the PrimaryWindow is despawned? Docs aren't super clear about what PrimaryWindow means.

@mockersf
Copy link
Member Author

mockersf commented Jun 5, 2024

Side-question (this PR seems useful regardless): should Bevy promote another Window to PrimaryWindow when the PrimaryWindow is despawned? Docs aren't super clear about what PrimaryWindow means.

I tried that at first (if there is no primary window, promote the first window to it) because it seemed simpler, but that didn't work nicely. Do you despawn cameras that are targeting the primary window with the primary window? We should have an answer for that, but that need more design...

@rparrett
Copy link
Contributor

rparrett commented Jun 5, 2024

tried that at first (if there is no primary window, promote the first window to it) because it seemed simpler, but that didn't work nicely. Do you despawn cameras that are targeting the primary window with the primary window? We should have an answer for that, but that need more design...

Yeah, it feels like something the user should manage to me. I would imagine that most of the time, users would not want to allow the primary window to be despawned in the first place. Just surfacing the idea because it seemed like an "obvious" fix.

@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jun 5, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see this done across the UI stack: multi-window UI is the primary consumer of multiple windows.

@mockersf
Copy link
Member Author

mockersf commented Jun 5, 2024

Side-question (this PR seems useful regardless): should Bevy promote another Window to PrimaryWindow when the PrimaryWindow is despawned? Docs aren't super clear about what PrimaryWindow means.

let's discuss in #13698

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 6, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 6, 2024
Merged via the queue into bevyengine:main with commit 3d9b1e4 Jun 6, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

closing the main window change UI in the second window
4 participants