Skip to content
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

Render UI To Texture & Multiple Apps #125

Open
Braymatter opened this issue Jul 21, 2022 · 1 comment
Open

Render UI To Texture & Multiple Apps #125

Braymatter opened this issue Jul 21, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Braymatter
Copy link

Draft: Render a Kayak UI to a Texture

I've got a use case where I'd like to render multiple Kayak UI Applications and Mount them in world space. As an example having computer kiosks in the world

I was on the fence about making these two separate pull requests but mounting an App in worldspace \ render texture would almost definitely be something done in addition to mounting a HUD to the UI camera as well.

Having Multiple Kayak Apps

This would require making BevyContext a component instead of a Resource and providing a system that will call render on each BevyContext. Will also require updating process_events to consume BevyContext components and likely we'll need to create an IndexResource.

Another wrinkle is handling input on WorldSpace UI's. A basic solution could be to use bevy_mod_picking to raycast on click and create a synthetic click event if the clicked object has a BevyContext component.

We can address keyboard inputs to the last clicked UI in worldspace, or if the last click was not on a worldspace UI we can fallback to the UICamera App. We'll probably want to provide the world space UI's some mechanism for automatically yielding an input if camera is out of a certain radius, or possibly a more generic predicate provided by the user

Rendering Multiple Apps

Our initial thought is to have the BevyApp render to a texture and map provide that texture to the User to place within the world as they wish.

@Braymatter Braymatter changed the title Render UI To Texture Render UI To Texture & Multiple Apps Jul 21, 2022
@StarArawn StarArawn added the enhancement New feature or request label Aug 18, 2022
@StarArawn
Copy link
Owner

StarArawn commented Aug 18, 2022

This is partially finished with the 0.8 update and I've added a basic example here:
#137

Input handling is difficult and I'm not sure exactly how we want to handle that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants