unavi-xyz / unavi

⬜ Open-source VR social platform.
https://unavi.xyz
Mozilla Public License 2.0
84 stars 19 forks source link

UI Library #834

Open kayhhh opened 11 months ago

kayhhh commented 11 months ago

We should create a library of UI components designed for VR (but also works in non-VR).

We could try building with some existing UI library, but from my knowledge these are all 2D UI components, which would mean in VR we render that on a flat plane and interact with it using hand lasers. This is the de-facto approach most VR apps take, but I want to experiment with more expressive 3D UI elements to capitalize on the VR medium.

Additionally, I got to thinking about how we should implement this, or more where we should implement this. Rather than build this as bevy components and systems, what if we created the UI library within the WASM scripting framework? This would allow us to provide a well-tested UI library that anyone could use within their worlds. Dogfooding our scripting APIs and tooling would be a great way to ensure they are both high quality and powerful.

This would probably mean we write all menus using these UI components within the WASM as well - settings menu, world browser, friends list, etc. To use the settings menu as an example, we would need some set of "system" scripts connecting the WASM environment to the corresponding settings in bevy. Not sure exactly how this works currently but it should be doable. We may need to figure out script permissions to do this, so only our trusted settings menu script is allowed to change settings. We don't want some random user script changing the settings of everyone in the world.