Skip to content

[Merged by Bors] - Add ControlNode for UI#2908

Closed
TheRawMeatball wants to merge 7 commits intobevyengine:mainfrom
TheRawMeatball:control-node
Closed

[Merged by Bors] - Add ControlNode for UI#2908
TheRawMeatball wants to merge 7 commits intobevyengine:mainfrom
TheRawMeatball:control-node

Conversation

@TheRawMeatball
Copy link
Member

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).

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Oct 2, 2021
@TheRawMeatball TheRawMeatball added A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible S-Needs-Review and removed S-Needs-Triage This issue needs to be labelled labels Oct 2, 2021
@TheRawMeatball
Copy link
Member Author

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.

@mockersf
Copy link
Member

mockersf commented Oct 4, 2021

Code looks good, but could you show an example where this is useful?

@TheRawMeatball
Copy link
Member Author

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.

Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

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

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 👍

@mockersf mockersf 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 labels Oct 5, 2021
@mockersf
Copy link
Member

mockersf commented Oct 6, 2021

bors r+

bors bot pushed a commit that referenced this pull request Oct 6, 2021
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).
@bors bors bot changed the title Add ControlNode for UI [Merged by Bors] - Add ControlNode for UI Oct 6, 2021
@bors bors bot closed this Oct 6, 2021
@cart
Copy link
Member

cart commented Oct 6, 2021

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.

@mockersf
Copy link
Member

mockersf commented Oct 6, 2021

ok!

Davier added a commit to Davier/bevy that referenced this pull request Dec 3, 2021
`ControlNode`s where added in bevyengine#2908 in main, while bevy_ui2 was being developped in the pipelined-rendering branch.
Davier added a commit to Davier/bevy that referenced this pull request Dec 10, 2021
`ControlNode`s where added in bevyengine#2908 in main, while bevy_ui2 was being developped in the pipelined-rendering branch.
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-Feature A new feature, making something new possible 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.

4 participants