From 322e0dbcb676342c546c3db5e9494114808e0377 Mon Sep 17 00:00:00 2001 From: JMS55 <47158642+JMS55@users.noreply.github.com> Date: Sat, 16 Dec 2023 21:21:32 -0800 Subject: [PATCH] Improve demo styling --- examples/demo.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/demo.rs b/examples/demo.rs index 61ba3b9..2e142e9 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -1,6 +1,6 @@ use bevy::{ app::{App, Startup}, - core::DebugName, + core::{DebugName, Name}, core_pipeline::core_2d::Camera2dBundle, ecs::{entity::Entity, query::Without, system::Commands}, ui::{node_bundles::NodeBundle, Node}, @@ -19,7 +19,7 @@ fn main() { dioxus_ui_root: DioxusUiRoot(Editor), node_bundle: NodeBundle::default(), }); - commands.spawn(Camera2dBundle::default()); + commands.spawn((Camera2dBundle::default(), Name::new("Camera"))); }) .run(); } @@ -58,9 +58,12 @@ fn SceneTree<'a>(cx: Scope, selected_entity: &'a UseState>) -> El for (entity, name) in entities { div { onclick: move |_| selected_entity.set(Some(entity)), - padding: "12", + padding: "8", background_color: if Some(entity) == ***selected_entity { INDIGO_600 } else { NEUTRAL_800 }, - format!("{name:?}") + match name.name { + Some(name) => format!("{name}"), + _ => format!("Entity ({:?})", name.entity) + } } } }