-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Move UI Transform
to a field on Node
#16615
base: main
Are you sure you want to change the base?
Conversation
* Required `GlobalTransform` instead of `Transform` on `Node`. * Update node's global transforms during layout updates.
…bevy into node-global-transform
I like this as an incremental move forward. We shouldn't be storing a full Should this be on |
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
This does seem like the least-bad option. But I thought there was code in I believe this should fix the issues |
The new transform field on I made another branch first just before this one that removed both |
I haven't seen anything like this. Afaik the only way to opt-out of transform propagation is by removing |
Objective
Animating UI elements by modifying the
Transform
component of UI nodes doesn't work very well becauseui_layout_system
overwrites the translations each frame. Theoverflow_debug
example uses a horrible hack where it copies the transform into the position that'll likely cause a panic if any users naively copy it.Solution
There have been a couple of other attempts to fix this with
UiTransform
components etc but they were quite complicated and controversial and got bogged down in review. So I thought about it again and came up with this simpler alternative:GlobalTransform
instead ofTransform
onNode
.transform: Transform
field toNode
.