bevy_dioxus icon indicating copy to clipboard operation
bevy_dioxus copied to clipboard

Static UI as assets

Open JMS55 opened this issue 2 years ago • 1 comments

Composing UI, especially reactive UI, as code is good. But for some types of games, it would be nice to generate static UI visually in the editor.

Open questions:

  1. How do we map hand-written rsx syntax in an asset file -> dioxus UI element/templates at runtime?
  2. Can we support defining the template by hand, and then passing in code-defined props and ECS-data-via-hooks to make the parts of the UI dynamic?
  3. Do we need to hookup a VirtualDom to for asset-based UIs (assuming we don't hydrate the static asset with dynamic parts)? It might suffice to simply spawn the appropriate entities once, and skip setting up mutations.

JMS55 avatar Dec 19 '23 06:12 JMS55

We can parse rust-code-as-a-string into rsx with syn::parse_str::<T>(), where T: BodyNode.

JMS55 avatar Dec 19 '23 20:12 JMS55