Merge "[3.0] Clipping API feature in Actor" into tizen
[platform/core/uifw/dali-demo.git] / examples / scripting / launcher.cpp
index 2d31d2d..2362696 100644 (file)
 #include <sys/stat.h>
 #include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
+#include "shared/view.h"
 
 
 using namespace Dali;
+using namespace Dali::Toolkit;
 
 #define TOKEN_STRING(x) #x
 
@@ -45,7 +48,6 @@ Launcher::Launcher( Dali::Application application, std::string layoutFileName, s
   mJSONFileName(layoutFileName ),
   mJavaScriptFileName( scriptFileName )
 {
-
   mApplication.InitSignal().Connect( this, &Launcher::Create );
 }
 
@@ -55,9 +57,19 @@ Launcher::~Launcher()
 
 void Launcher::Create( Dali::Application& application )
 {
+  TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." );
+
+  // Reposition the actor
+  textActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  textActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  textActor.SetPosition( 20, 0 );
+
   // Get a handle to the stage
   Stage stage = Stage::GetCurrent();
 
+  // Display the actor on the stage
+  stage.Add( textActor );
+
   // change the background color to purple
   Stage::GetCurrent().SetBackgroundColor( Vector4(0.2,0.2,0.4,1.0) );
 
@@ -67,9 +79,9 @@ void Launcher::Create( Dali::Application& application )
     mBuilder = Toolkit::Builder::New();
 
     Property::Map defaultDirs;
-    defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ]  = DALI_IMAGE_DIR;
-    defaultDirs[ TOKEN_STRING(DALI_MODEL_DIR) ]  = DALI_MODEL_DIR;
-    defaultDirs[ TOKEN_STRING(DALI_SCRIPT_DIR) ] = DALI_SCRIPT_DIR;
+    defaultDirs[ TOKEN_STRING(DEMO_IMAGE_DIR) ]  = DEMO_IMAGE_DIR;
+    defaultDirs[ TOKEN_STRING(DEMO_MODEL_DIR) ]  = DEMO_MODEL_DIR;
+    defaultDirs[ TOKEN_STRING(DEMO_SCRIPT_DIR) ] = DEMO_SCRIPT_DIR;
     mBuilder.AddConstants( defaultDirs );
 
     std::string json_data(GetFileContents( mJSONFileName ));