[Merged by Bors] - Add ControlNode for UI#2908
[Merged by Bors] - Add ControlNode for UI#2908TheRawMeatball wants to merge 7 commits intobevyengine:mainfrom
Conversation
|
Something we should consider is whether to move this into bevy_transform instead - this form of "children transparency" could be useful elsewhere, and having a common component all others base things around could be a good idea. |
|
Code looks good, but could you show an example where this is useful? |
|
This increases the flexibility of the hierarchy by letting other crates store more complex information in the UI hierarchy while still having it work. I'm personally using this in ui4 to encode the control structure inside the ECS as deeper levels of nesting, and this change made things drastically simpler. |
mockersf
left a comment
There was a problem hiding this comment.
I guess we'll have a new kind of issues with people adding ControlNode where it shouldn't, but this will be for people doing complicated things with UI so they're already torturing themselves 👍
|
bors r+ |
This PR adds a ControlNode which marks an entity as "transparent" to the UI layout system, meaning the children of this entity will be treated as the children of this entity s parent by the layout system(s).
|
This enables what I would call "opinionated" UI patterns. I do like that this helps @TheRawMeatball explore new UI patterns, and given that the current Bevy UI probably isn't long for this world, I'm cool with leaving this merged. But in the future I'd prefer to weigh in on stuff like this prior to merging. |
|
ok! |
`ControlNode`s where added in bevyengine#2908 in main, while bevy_ui2 was being developped in the pipelined-rendering branch.
`ControlNode`s where added in bevyengine#2908 in main, while bevy_ui2 was being developped in the pipelined-rendering branch.
This PR adds a ControlNode which marks an entity as "transparent" to the UI layout system, meaning the children of this entity will be treated as the children of this entity s parent by the layout system(s).