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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃枼 UI System #4

Closed
zicklag opened this issue Apr 5, 2021 · 7 comments
Closed

馃枼 UI System #4

zicklag opened this issue Apr 5, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@zicklag
Copy link
Member

zicklag commented Apr 5, 2021

We need the basics necessary for UI:

  • Sprites that can be anchored to different sides of the screen
  • Possibly use a ninepatch system similar to bevy_ninepatch.
  • A sprite-based text and font system.
@zicklag zicklag added the enhancement New feature or request label Apr 5, 2021
@zicklag
Copy link
Member Author

zicklag commented Apr 16, 2021

It will take more investigation, but I think building on top of Iced might be a good idea. It's so modularized that we could potentially just take it's very core features and the Elm-like runtime and then totally design our own widgets and layout stuff to be simple however we need it for Bevy Retro.

We could try out Bevy's UI, too, but I have a feeling using Bevy's UI with our own renderer will not work quite right, and the I think Bevy UI is going to be changing a lot so I'm not sure that I want to bet on it just yet. Not that Iced isn't changing either, I just feel that it's going to be more fleshed out.

@zicklag
Copy link
Member Author

zicklag commented Apr 16, 2021

And I'm re-thinking that again, actually. We've already got the ECS for state storage so the ELM architecture might not make a ton of sense here. Anyway, going to be doing some searching around and running experiments.

@zicklag
Copy link
Member Author

zicklag commented Apr 21, 2021

Just finished implementing render hooks which give us a way to modularly extend the renderer. This will allow us to add the UI renderer as a separate render hook.

For UI we are looking into using the RAUI crate which appears to have all the features we need.

@zicklag
Copy link
Member Author

zicklag commented Apr 29, 2021

Great progress has been made supporting UI with RAUI: RAUI-labs/raui#17!

There's currently an example that needs work, but is functional: https://github.com/katharostech/bevy_retro/blob/8a44707cb1324951127b62c612d061862dd745c0/examples/ui.rs#L1

bevyRetroUi

@zicklag
Copy link
Member Author

zicklag commented May 14, 2021

Got the rendering finished up, just have to get it hooked up so you can interact with the ECS world somehow. We've gotten a good rendering example going now:

working-button

@zicklag zicklag pinned this issue May 14, 2021
@zicklag
Copy link
Member Author

zicklag commented May 15, 2021

Almost finished! Got it hooked up to the ECS. Needs a change to RAUI that still needs review, but I think we'll be able to make it work somehow.

We can now get access to the Bevy World inside of the widget components allowing us to send events, mutate entities, read resources, etc. Already the Radishmark examle is using it to display the FPS counter and the new UI example can send events to move the background image when you click the button!

ui

@zicklag
Copy link
Member Author

zicklag commented May 18, 2021

Well, I'm going to consider UI "finished"! There might be more work to do, but I'll create more issues for those. Our PR to RAUI has been accepted and should be merged soon and UI is usable right now in Bevy Retro as it points to our RAUI fork.

馃帀 馃帀 馃帀

@zicklag zicklag closed this as completed May 18, 2021
@zicklag zicklag unpinned this issue May 19, 2021
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

1 participant