bevy_easy_ui: A declarative, fluent builder-pattern abstraction layer on top of Bevy's UI system #24581
nv-dev-user
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
Before anything, I would like to thank the Bevy team for this amazing engine and the welcoming community around it. I've been using Bevy for some time now and I really appreciate how powerful and flexible it is.
I've just published the first release of
bevy_easy_ui(v0.1.1) on crates.io. The goal is to make building UIs in Bevy feel a bit more straightforward: it's a fluent builder-pattern abstraction layer that wraps Bevy's UI components in a more intuitive API, with type-checked setters, seamless chaining, and a clear separation between container and non-container widgets. Hope it helps you build UIs faster!About
Before — the standard Bevy way:
After — with
bevy_easy_ui:Every setter is chainable, type-checked, and the trait system prevents misusing a container as a non-container (or vice versa).
What's in the box
The crate ships a set of
Easy*builders, each wrapping the matching Bevy component(s):EasyVerticalLayout/EasyHorizontalLayoutNode+FlexDirectionEasyButtonButton+NodeEasyRichTextText+TextSpanchildrenEasyViewportNode+ViewportNodeEasyLabel/EasyText/EasySpanText+Node(+Label)EasyImageImageNode+NodeEasyTextInputbevy_ui_text_inputA few things worth pointing out:
with_style(EasyXxxStyle)— a single setter that swaps the wholeNode+EasyBoxStyle+EasyStackStyle(+ text style where relevant) at once. Handy for theming.ScrollPlugin— a tiny plugin that turns the mouse wheel into aScrollevent consumable by anyOverflow::scroll_*()node. HoldCtrlwhile scrolling to scroll horizontally instead..with_observer(...)on any container, attached as a real Bevy observer (Pointer<Over>,Pointer<Out>,Pointer<Click>, etc.).bevy::color::palettes::css::*, soWHITE,BLACK,BLUE,DARK_GRAY,LIGHT_BLUE, … all flow into.with_*_color(...into())without extra imports.What it doesn't try to do (yet)
bevy_easy_uiis still under active development, and the 0.1.1 release focuses on getting the core layout, text, image, and input surfaces right. Some things are out of scope for now:Checkbox,Slider,RadioButton+RadioGroup, andScrollbar.0.1.x is young — the API works and is covered by eight examples, but it's still an early release. Names and patterns may move. Bug reports and PRs are genuinely welcome, and any feedback you have is greatly appreciated.
Version compatibility
bevy_easy_uibevy_ui_text_inputbevyHow to try it
Add it to your
Cargo.toml:…then:
(The repo has eight examples in total —
hello,button_with_observers,image_button,rounded_image,scroll,viewport,rich_text, andtext_input.)Links
Beta Was this translation helpful? Give feedback.
All reactions