Skip to content

Conversation

@MushineLament
Copy link
Contributor

@MushineLament MushineLament commented Nov 12, 2025

Preface

I still have many unresolved issues. I am publishing this PR to gain more attention and opinions. Ensure the integrity of this feature.

I have already implemented some of the basic expected functions, but I have not conducted testing and improved the documentation. However, I have added an example.For example, the bevy_ui_contain feature needs to be enabled.

Existing problems:

  • Fix node rotation
  • UiTransform based on UiContain Transform
  • Layout based on UiContain size
  • UiContainTarget passes to child nodes
  • Support Anchor
  • UiContain Support Overflow
  • performance optimization

...

Expectations and difficulties:

  • Non root nodes take effect (May affect the entire Node)
  • UiContain supports Visibility (Restricted by the relationship of visibility)

Objective

Fixes #21278
Try #5476

Solution

  1. Add a UiContain component for storing Ui.
  2. Add UiContainTarget component and declare that Node belongs to UiContain.
  3. Enable UiSurface to support components, with each UiContain unique to manage Node Layout
    4.Camera is a screen based "container" for Node Ui, so Containing is a world based "container".

Testing

  • Did you test these changes? If so, how?
    I already have the outline of testing, but I haven't written the test yet.But I have enabled a new feature for isolation to ensure that other functions are not affected

  • Are there any parts that need more testing?
    Need to test whether the Node size, shape, image display, button function, etc. based on Component UiSurface are correct.


Showcase

Quicker_20251112_123214

@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-21812

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UiSurface should implement component,no just for the camera

1 participant