Commit 58d399c7397a4574dfbfd74793c27ae0ffc1fb65

Authored by Tom Robinson
1 parent 19369b28

Stencil Renderer demo: Toolbar removed

Change-Id: I0e61ab6668a28c000571b957e482f1845c3705be
examples/renderer-stencil/renderer-stencil-example.cpp
... ... @@ -33,7 +33,6 @@ namespace
33 33  
34 34 // Application constants:
35 35 const char * const APPLICATION_TITLE( "Renderer Stencil API Demo" );
36   -const char * const TOOLBAR_IMAGE( DEMO_IMAGE_DIR "top-bar.png" );
37 36 const char * const BACKGROUND_IMAGE( DEMO_IMAGE_DIR "background-gradient.jpg" );
38 37  
39 38 // Texture filenames:
... ... @@ -52,6 +51,7 @@ const float ANIMATION_BOUNCE_DEFORMATION_PERCENT( 20.0f ); ///< Percentage (of t
52 51 const float ANIMATION_BOUNCE_HEIGHT_PERCENT( 40.0f ); ///< Percentage (of the cube's size) to bounce up in to the air by.
53 52  
54 53 // Base colors for the objects:
  54 +const Vector4 TEXT_COLOR( 1.0f, 1.0f, 1.0f, 1.0f ); ///< White.
55 55 const Vector4 CUBE_COLOR( 1.0f, 1.0f, 1.0f, 1.0f ); ///< White.
56 56 const Vector4 FLOOR_COLOR( 1.0f, 1.0f, 1.0f, 1.0f ); ///< White.
57 57 const Vector4 REFLECTION_COLOR( 0.6f, 0.6f, 0.6f, 0.6f ); ///< Note that alpha is not 1.0f, to make the blend more photo-realistic.
... ... @@ -116,11 +116,26 @@ private:
116 116 {
117 117 Stage stage = Stage::GetCurrent();
118 118  
119   - // Creates a default view with a default tool-bar.
120   - // The view is added to the stage.
121   - Toolkit::ToolBar toolBar;
122   - Layer toolBarLayer = DemoHelper::CreateView( application, mView, toolBar, BACKGROUND_IMAGE, TOOLBAR_IMAGE, APPLICATION_TITLE );
123   - stage.Add( toolBarLayer );
  119 + // Creates the background image.
  120 + Toolkit::Control background = Dali::Toolkit::Control::New();
  121 + background.SetAnchorPoint( Dali::AnchorPoint::CENTER );
  122 + background.SetParentOrigin( Dali::ParentOrigin::CENTER );
  123 + background.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
  124 + Dali::Property::Map map;
  125 + map["rendererType"] = "IMAGE";
  126 + map["url"] = BACKGROUND_IMAGE;
  127 + background.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
  128 + stage.Add( background );
  129 +
  130 + // Create a TextLabel for the application title.
  131 + Toolkit::TextLabel label = Toolkit::TextLabel::New( APPLICATION_TITLE );
  132 + label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
  133 + // Set the parent origin to a small percentage below the top (so the demo will scale for different resolutions).
  134 + label.SetParentOrigin( Vector3( 0.5f, 0.03f, 0.5f ) );
  135 + label.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
  136 + label.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
  137 + label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, TEXT_COLOR );
  138 + stage.Add( label );
124 139  
125 140 // Layer to hold the 3D scene.
126 141 Layer layer = Layer::New();
... ...