+ baseLayer.Add( shaderButton );
+
+ //Create button for pausing animations
+ Toolkit::PushButton pauseButton = Toolkit::PushButton::New();
+ pauseButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ pauseButton.ClickedSignal().Connect( this, &MeshRendererController::OnPauseClicked );
+ pauseButton.SetParentOrigin( Vector3( 0.5, 0.95, 0.5 ) ); //Offset from bottom center
+ pauseButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ pauseButton.SetLabelText( " || " );
+ baseLayer.Add( pauseButton );
+
+ //Create control to act as light source of scene.
+ mLightSource = Control::New();
+ mLightSource.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
+ mLightSource.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+ mLightSource.RegisterProperty( "Tag", LIGHT_TAG );
+
+ //Set position relative to top left, as the light source property is also relative to the top left.
+ mLightSource.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ mLightSource.SetAnchorPoint( AnchorPoint::CENTER );
+ mLightSource.SetPosition( Stage::GetCurrent().GetSize().x * 0.5f, Stage::GetCurrent().GetSize().y * 0.1f );
+
+ //Make white background.
+ Property::Map lightMap;
+ lightMap.Insert( "rendererType", "COLOR" );
+ lightMap.Insert( "mixColor", Color::WHITE );
+ mLightSource.SetProperty( Control::Property::BACKGROUND, Property::Value( lightMap ) );
+
+ //Label to show what this actor is for the user.
+ TextLabel lightLabel = TextLabel::New( "Light" );
+ lightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ lightLabel.SetParentOrigin( ParentOrigin::CENTER );
+ lightLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ float padding = 5.0f;
+ lightLabel.SetPadding( Padding( padding, padding, padding, padding ) );
+ mLightSource.Add( lightLabel );
+
+ //Connect to touch signal for dragging.
+ mLightSource.TouchedSignal().Connect( this, &MeshRendererController::OnTouch );
+
+ //Place the light source on a layer above the base, so that it is rendered above everything else.
+ Layer upperLayer = Layer::New();
+ baseLayer.Add( upperLayer );
+ upperLayer.Add( mLightSource );
+
+ //Calling this sets the light position of each model to that of the light source control.
+ UpdateLight();