Switch paper example
TuntematonSotilas opened this issue · 12 comments
Hello could you provide us a working example of the switch_paper
component ?
It could be integrated into the existing demo
i believe it's about tabs and their contents - i could upgrade in-game demo with more game focused UI examples (RPG games has nearly the most complex and most commonly used UI widgets).
actually we could turn in-game demo into a simple RPG-like mini game that gameplay-wise does as less as possible, yet it wil show all latest changes in RAUI and how to use them in typical game scenario
ok, i've figured out how to make tabs component - gonna add that one to material library
i've started making examples for each of the component, switch and prolly tabs is gonna be published today :D
added examples for switch box and a couple of other core container components, pushed to next
branch now, tomorrow i'll add interactive components and will push new version (i've improved raui-quick-start to allow use of callbacks within tetra context, and added support for passing process context to app builder).
along with RAUI new version i'll update RAUI in Oxygengine and push new version of it too tomorrow :)
i have finished adding examples for all core components, they are all on next
branch in examples folder (i had to wait with publishing new version until i got all of them covered)
@TuntematonSotilas tabs_box
example :D now have to make material version of it.
also i've added a node variant called Tuple and its only purpose is to be able to pack sets of nodes into tuples that you should unpack in your component:
.listed_slot(WidgetNode::pack_tuple([
make_widget!(image_box)
.with_props(ImageBoxProps::colored(Color {
r: 1.0,
g: 0.25,
b: 0.25,
a: 1.0,
}))
.into(),
make_widget!(image_box)
.with_props(ImageBoxProps::colored(Color {
r: 0.75,
g: 0.25,
b: 0.25,
a: 1.0,
}))
.into(),
]))
i use it here to list pairs of tab-content items:
for (index, item) in listed_slots.into_iter().enumerate() {
let [tab, content] = item.unpack_tuple();
}
hmm, actually i don't think i need to make a material/paper version of tabs_box because user can just wrap tabs box in paper and that's all to do
I like the idea of not adding more components than necessary that do similar things. Gives you more to learn, if there's more than one way to do things.
ok, tabs box pushed to next
, it's finally the time to publish new version. that was a lot of work :D
Good job, man!
new version is now on crates and docs :D