From 532c1258146e3c9d6fd75e7f284aaa8339a8b79a Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 12 Jul 2024 10:53:12 +0100 Subject: [PATCH] Ensure Scene3d-Light exit on Escape --- examples-reel/dali-examples-reel.cpp | 1 - examples/scene3d-light/scene3d-light-example.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples-reel/dali-examples-reel.cpp b/examples-reel/dali-examples-reel.cpp index b6c5e66..e7c9398 100644 --- a/examples-reel/dali-examples-reel.cpp +++ b/examples-reel/dali-examples-reel.cpp @@ -93,7 +93,6 @@ int DALI_EXPORT_API main(int argc, char** argv) demo.AddExample(Example("rendering-textured-cube.example", DALI_DEMO_STR_TITLE_RENDERING_TEXTURED_CUBE)); demo.AddExample(Example("rendering-radial-progress.example", DALI_DEMO_STR_TITLE_RENDERING_RADIAL_PROGRESS)); demo.AddExample(Example("ray-marching.example", DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING)); - demo.AddExample(Example("scene3d.example", DALI_DEMO_STR_TITLE_SCENE3D)); demo.AddExample(Example("scene3d-light.example", DALI_DEMO_STR_TITLE_SCENE3D_LIGHT)); demo.AddExample(Example("scene3d-model.example", DALI_DEMO_STR_TITLE_SCENE3D_MODEL)); demo.AddExample(Example("scroll-view.example", DALI_DEMO_STR_TITLE_SCROLL_VIEW)); diff --git a/examples/scene3d-light/scene3d-light-example.cpp b/examples/scene3d-light/scene3d-light-example.cpp index e5bf406..f7173fd 100644 --- a/examples/scene3d-light/scene3d-light-example.cpp +++ b/examples/scene3d-light/scene3d-light-example.cpp @@ -128,6 +128,12 @@ public: window.Add(sceneView); + auto text = TextLabel::New("Press keys 0-9 to change lighting"); + text[Actor::Property::PARENT_ORIGIN]=ParentOrigin::BOTTOM_CENTER; + text[Actor::Property::ANCHOR_POINT]=AnchorPoint::BOTTOM_CENTER; + text[TextLabel::Property::TEXT_COLOR] = Color::BLACK; + window.Add(text); + // Respond to a touch anywhere on the window window.GetRootLayer().TouchedSignal().Connect(this, &Scene3dLightController::OnTouch); @@ -265,6 +271,10 @@ public: mAnimation.SetCurrentProgress(progress); mAnimation.Pause(); } + else if(IsKey(event, Dali::DALI_KEY_ESCAPE) || IsKey(event, Dali::DALI_KEY_BACK)) + { + mApplication.Quit(); + } } } -- libgit2 0.21.4