Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Add a viewport widget. Though I've marked this as a draft, I'm happy to receive reviews :)
Solution
Viewport
component with fieldcamera
that points to the camera to render.viewport_picking
to pass pointer inputs from other pointers to the viewport's pointer.on_viewport_added
function to spawn anImageNode
andPointerId
for the viewport entity.ImageNode
is spawned as a child of the viewport entity.update_viewport_render_target_size
to update the viewport's render target's size if the node size changes.bevy_ui_picking_backend
(subject to change).Testing
I've been using an example I made to test the widget:
Code
Showcase
2025-01-09.00-32-30.mp4
To do
Viewport
is removed.Open Questions
bevy_ui_picking_backend
or not? I chose a partial approach since maybe someone will want to use the widget without any picking being involved.NodeImage
for the viewport shouldn't be automatically added?