*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
// Connect to the Application's Init signal
mApplication.InitSignal().Connect( this, &Model3dViewController::Create );
{
// Connect to the Application's Init signal
mApplication.InitSignal().Connect( this, &Model3dViewController::Create );
// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
- // Get a handle to the stage
- Stage stage = Stage::GetCurrent();
- Vector2 screenSize = stage.GetSize();
+ // Get a handle to the window
+ Window window = application.GetWindow();
+ Vector2 screenSize = window.GetSize();
- backView.SetParentOrigin( ParentOrigin::CENTER );
- backView.SetAnchorPoint( AnchorPoint::CENTER );
- stage.Add( backView );
+ backView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ backView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ window.Add( backView );
- mModel3dView.SetParentOrigin( ParentOrigin::CENTER );
- mModel3dView.SetAnchorPoint( AnchorPoint::CENTER );
- mModel3dView.SetName( "model3dViewControl" );
+ mModel3dView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mModel3dView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mModel3dView.SetProperty( Dali::Actor::Property::NAME, "model3dViewControl" );
mModel3dView.SetProperty(Model3dView::Property::LIGHT_POSITION, Vector3(5,10.,0));
mModel3dView.SetProperty(Model3dView::Property::LIGHT_POSITION, Vector3(5,10.,0));
mButtonLayer = Layer::New();
mButtonLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mButtonLayer = Layer::New();
mButtonLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mButtonLayer.SetParentOrigin( ParentOrigin::CENTER );
- mButtonLayer.SetAnchorPoint( AnchorPoint::CENTER );
- stage.Add( mButtonLayer );
+ mButtonLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mButtonLayer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ window.Add(mButtonLayer);
// Create button for model changing
Toolkit::PushButton editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked);
// Create button for model changing
Toolkit::PushButton editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeModelClicked);
- editButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- editButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- editButton.SetLabelText( "Change Model" );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Model" );
mButtonLayer.Add( editButton );
// Create button for shader changing
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked);
mButtonLayer.Add( editButton );
// Create button for shader changing
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnChangeLightingClicked);
- editButton.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- editButton.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
- editButton.SetLabelText( "Change Shader" );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT );
+ editButton.SetProperty( Toolkit::Button::Property::LABEL, "Change Shader" );
mButtonLayer.Add( editButton );
// Create button for pause/resume animation
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked);
mButtonLayer.Add( editButton );
// Create button for pause/resume animation
editButton = Toolkit::PushButton::New();
editButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
editButton.ClickedSignal().Connect( this, &Model3dViewController::OnPauseAnimationsClicked);
- editButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- editButton.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- editButton.SetLabelText( "Pause Animations" );
+ editButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+ editButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+ editButton.SetProperty( Toolkit::Button::Property::LABEL, "Pause Animations" );
- // Respond to a click anywhere on the stage
- stage.KeyEventSignal().Connect(this, &Model3dViewController::OnKeyEvent);
+ // Respond to a click anywhere on the window
+ window.KeyEventSignal().Connect(this, &Model3dViewController::OnKeyEvent);
- mModel3dView.SetScale(1.0);
- mModel3dView.SetPosition(0,0,0);
+ mModel3dView.SetProperty( Actor::Property::SCALE, 1.0f );
+ mModel3dView.SetProperty( Actor::Property::POSITION, Vector3( 0, 0, 0 ) );
- mModel3dView.SetScale(size);
- mModel3dView.SetPosition(-position.x * size,-position.y * size, 0);
+ mModel3dView.SetProperty( Actor::Property::SCALE, size );
+ mModel3dView.SetProperty( Actor::Property::POSITION, Vector3( -position.x * size, -position.y * size, 0 ) );
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );