diff --git a/examples/bevy.rs b/examples/bevy.rs index de2fa16b5b1349b4bb9e227254307c89c7bfe500..54e72cbefe42aeddd825f2d7dceb915c70fb41d2 100644 --- a/examples/bevy.rs +++ b/examples/bevy.rs @@ -6,7 +6,7 @@ use bevy::{ }; use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}; use kayak_ui::core::Index; -use kayak_ui::core::{rsx, widget}; +use kayak_ui::core::{render, rsx, widget}; use kayak_widgets::{App, Window}; #[widget] @@ -40,11 +40,7 @@ fn startup( }; let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - - rsx! { + render! { <App styles={Some(styles.clone())}> <Window position={(50.0, 50.0)} size={(300.0, 300.0)} title={"Window 1".to_string()}> {} diff --git a/examples/clipping.rs b/examples/clipping.rs index f3fb5da41cd92d00b935d5b9f54970f62b6fa04d..d33210b7f2cadfd03bc76ea6b2957f22317702b2 100644 --- a/examples/clipping.rs +++ b/examples/clipping.rs @@ -7,7 +7,7 @@ use bevy::{ use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, ImageManager, UICameraBundle}; use kayak_ui::core::{ layout_cache::Space, - rsx, + render, styles::{Style, StyleProp, Units}, Index, }; @@ -34,10 +34,6 @@ fn startup( let panel_brown_handle = image_manager.get(&handle); let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - let nine_patch_styles = Style { width: StyleProp::Value(Units::Pixels(512.0)), height: StyleProp::Value(Units::Pixels(512.0)), @@ -72,7 +68,7 @@ Vivamus pulvinar dui et elit volutpat hendrerit. Praesent luctus dolor ut rutrum Vestibulum rutrum imperdiet nisl, et consequat massa porttitor vel. Ut velit justo, vehicula a nulla eu, auctor eleifend metus. Ut egestas malesuada metus, sit amet pretium nunc commodo ac. Pellentesque gravida, nisl in faucibus volutpat, libero turpis mattis orci, vitae tincidunt ligula ligula ut tortor. Maecenas vehicula lobortis odio in molestie. Curabitur dictum elit sed arcu dictum, ut semper nunc cursus. Donec semper felis non nisl tincidunt elementum. "#.to_string(); - rsx! { + render! { <App styles={Some(styles.clone())}> <NinePatch styles={Some(nine_patch_styles)} diff --git a/examples/counter.rs b/examples/counter.rs index fd925c66bcf1bc3b431f16421aba0f511ed3ae09..8cc9258fcaebfd658185374c643f0d494025a21d 100644 --- a/examples/counter.rs +++ b/examples/counter.rs @@ -6,7 +6,7 @@ use bevy::{ }; use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}; use kayak_ui::core::{ - rsx, + render, rsx, styles::{Style, StyleProp, Units}, widget, Bound, EventType, Index, MutableBound, OnEvent, }; @@ -73,11 +73,7 @@ fn startup( }; let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - - rsx! { + render! { <App styles={Some(styles.clone())}> <Counter /> </App> diff --git a/examples/full_ui.rs b/examples/full_ui.rs index efa0aca8aeaff02062d68603b85a3829062c17b1..141c5e1cdfe221e71beb6fec700047af67c5274e 100644 --- a/examples/full_ui.rs +++ b/examples/full_ui.rs @@ -7,7 +7,7 @@ use bevy::{ use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, ImageManager, UICameraBundle}; use kayak_ui::core::{ layout_cache::Space, - rsx, + render, rsx, styles::{LayoutType, Style, StyleProp, Units}, widget, Bound, Children, EventType, Index, MutableBound, OnEvent, }; @@ -101,9 +101,6 @@ fn startup( let panel_brown_handle = image_manager.get(&handle); let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let nine_patch_styles = Style { layout_type: StyleProp::Value(LayoutType::Column), width: StyleProp::Value(Units::Pixels(512.0)), @@ -147,7 +144,7 @@ fn startup( ..Style::default() }; - rsx! { + render! { <App styles={Some(app_styles)}> <NinePatch styles={Some(nine_patch_styles)} diff --git a/examples/global_counter.rs b/examples/global_counter.rs index cbf2d0de573ff1bfd8116f641b6f2292020d6ab1..6a0691dce00d55fba538bbca5955cfdb556e9895 100644 --- a/examples/global_counter.rs +++ b/examples/global_counter.rs @@ -5,7 +5,7 @@ use bevy::{ DefaultPlugins, }; use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}; -use kayak_ui::core::{bind, rsx, widget, Binding, Bound, Index, MutableBound}; +use kayak_ui::core::{bind, render, rsx, widget, Binding, Bound, Index, MutableBound}; use kayak_widgets::{App, Text, Window}; #[derive(Clone, PartialEq)] @@ -57,10 +57,7 @@ fn startup( commands.insert_resource(bind(GlobalCount(0))); let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - rsx! { + render! { <App styles={Some(styles.clone())}> <Counter /> </App> diff --git a/examples/if.rs b/examples/if.rs index 288b8d4fb31b3dcd29ef5556c9e78ad9029f97a7..cb57cb2028da689a7dbbce3aeb6c68536c4761cf 100644 --- a/examples/if.rs +++ b/examples/if.rs @@ -6,7 +6,7 @@ use bevy::{ }; use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}; use kayak_ui::core::{ - rsx, + render, rsx, styles::{Style, StyleProp, Units}, widget, Bound, EventType, Index, MutableBound, OnEvent, }; @@ -75,12 +75,7 @@ fn startup( }; let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - let tree = kayak_ui::core::WidgetTree::new(); - - rsx! { + render! { <App styles={Some(styles.clone())}> <Removal /> </App> diff --git a/examples/image.rs b/examples/image.rs index 178d9e664924408104756dc19a7e8556c4abdec3..76725505702daeac526b412ee5a286c8ca35f3b7 100644 --- a/examples/image.rs +++ b/examples/image.rs @@ -5,7 +5,7 @@ use bevy::{ DefaultPlugins, }; use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, ImageManager, UICameraBundle}; -use kayak_ui::core::{rsx, Index}; +use kayak_ui::core::{render, Index}; use kayak_widgets::{App, Image}; fn startup( @@ -26,10 +26,7 @@ fn startup( let ui_image_handle = image_manager.get(&handle); let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - rsx! { + render! { <App styles={Some(styles.clone())}> <Image handle={ui_image_handle} /> </App> diff --git a/examples/nine_patch.rs b/examples/nine_patch.rs index 238cf5506a03d15cef2a170440a37f55874280c9..f608f7de1eb7c326741cf32c5bb28dba9c486d2f 100644 --- a/examples/nine_patch.rs +++ b/examples/nine_patch.rs @@ -7,7 +7,7 @@ use bevy::{ use kayak_ui::bevy::{BevyContext, BevyKayakUIPlugin, ImageManager, UICameraBundle}; use kayak_ui::core::{ layout_cache::Space, - rsx, + render, styles::{Style, StyleProp, Units}, Index, }; @@ -31,10 +31,6 @@ fn startup( let ui_image_handle = image_manager.get(&handle); let context = BevyContext::new(window_size.x, window_size.y, |styles, context| { - // Hack to trick the proc macro for right now.. - let parent_id: Option<Index> = None; - let children: Option<kayak_ui::core::Children> = None; - // The border prop splits up the image into 9 quadrants like so: // 1----2----3 // | | @@ -64,7 +60,7 @@ fn startup( ..Style::default() }; - rsx! { + render! { <App styles={Some(styles.clone())}> <NinePatch styles={Some(nine_patch_styles)}