(ArcVisual) Add code to update properties
[platform/core/uifw/dali-demo.git] / examples / effects-view / effects-view-example.cpp
index 4e00b84..597bd40 100644 (file)
@@ -140,15 +140,15 @@ void EffectsViewApp::OnAppInitialize( Application& application )
 
   Vector2 effectsViewSize( mStageSize.width, mStageSize.height * 0.25f );
   mDropShadowView = CreateEffectsView( EffectsView::DROP_SHADOW, effectsViewSize, mEffectSize );
-  mDropShadowView.SetParentOrigin( ParentOrigin::CENTER );
-  mDropShadowView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-  mDropShadowView.SetZ( -mStageSize.height * 0.1f );
+  mDropShadowView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  mDropShadowView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
+  mDropShadowView.SetProperty( Actor::Property::POSITION_Z,  -mStageSize.height * 0.1f );
   mContents.Add( mDropShadowView );
 
   mEmbossView = CreateEffectsView( EffectsView::EMBOSS, effectsViewSize, mEffectSize );
-  mEmbossView.SetParentOrigin( ParentOrigin::CENTER );
-  mEmbossView.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-  mEmbossView.SetZ( mStageSize.height * 0.1f );
+  mEmbossView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+  mEmbossView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+  mEmbossView.SetProperty( Actor::Property::POSITION_Z,  mStageSize.height * 0.1f );
   mContents.Add( mEmbossView );
 
   SetTitle( mEffectSize );
@@ -159,7 +159,7 @@ EffectsView EffectsViewApp::CreateEffectsView( EffectsView::EffectType type, con
 {
   Toolkit::EffectsView effectsView = Toolkit::EffectsView::New(type);
   // set control size
-   effectsView.SetSize( viewSize.width, viewSize.height );
+   effectsView.SetProperty( Actor::Property::SIZE, Vector2( viewSize.width, viewSize.height ) );
   // set effect size property
   effectsView.SetProperty( EffectsView::Property::EFFECT_SIZE, effectSize );
 
@@ -167,19 +167,19 @@ EffectsView EffectsViewApp::CreateEffectsView( EffectsView::EffectType type, con
   // text
   std::string text = ( type == EffectsView::DROP_SHADOW) ? "Drop Shadow" : "Emboss";
   TextLabel textActor( TextLabel::New( text ) );
-  textActor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
-  textActor.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-  textActor.SetSize( viewSize );
-  textActor.SetPosition( viewSize.width*0.4f, viewSize.height*0.3f );
+  textActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT );
+  textActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
+  textActor.SetProperty( Actor::Property::SIZE, viewSize );
+  textActor.SetProperty( Actor::Property::POSITION, Vector2( viewSize.width*0.4f, viewSize.height*0.3f ));
   textActor.SetProperty(  TextLabel::Property::POINT_SIZE, DemoHelper::ScalePointSize(14.f) );
   effectsView.Add( textActor );
 
   // image
   ImageView icon = ImageView::New( TEST_IMAGE );
-  icon.SetParentOrigin( ParentOrigin::CENTER_LEFT );
-  icon.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-  icon.SetX( viewSize.width*0.1f );
-  icon.SetSize( viewSize.height*0.8f, viewSize.height*0.8f );
+  icon.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT );
+  icon.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT );
+  icon.SetProperty( Actor::Property::POSITION_X,  viewSize.width*0.1f );
+  icon.SetProperty( Actor::Property::SIZE, Vector2( viewSize.height*0.8f, viewSize.height*0.8f ) );
   effectsView.Add( icon );
 
   AnimateEffectProperties( effectsView );