X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fbloom-view%2Fbloom-view-example.cpp;h=870c62c1df54c75ac361990663d2a0314a5d1b5e;hb=e3080a83ec85e14ec8cbf82831fd73b152c6e86a;hp=7c856c1f919415340596c8cbda4d5ada78d35a8d;hpb=e20235049b9916dab114ea6e02da2e3bca637ae8;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/bloom-view/bloom-view-example.cpp b/examples/bloom-view/bloom-view-example.cpp index 7c856c1..870c62c 100644 --- a/examples/bloom-view/bloom-view-example.cpp +++ b/examples/bloom-view/bloom-view-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,65 +72,65 @@ public: void Create( Application& application ) { - Stage stage = Stage::GetCurrent(); - Vector2 stageSize = stage.GetSize(); - Vector2 viewSize( stageSize ); + Window window = application.GetWindow(); + Vector2 windowSize = window.GetSize(); + Vector2 viewSize( windowSize ); mRootActor = Actor::New(); - mRootActor.SetParentOrigin( ParentOrigin::CENTER ); - mRootActor.SetSize( stageSize ); - stage.Add( mRootActor ); + mRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mRootActor.SetProperty( Actor::Property::SIZE, windowSize ); + window.Add( mRootActor ); // Create the object that will perform the blooming work mBloomView = Dali::Toolkit::BloomView::New(); - mBloomView.SetParentOrigin( ParentOrigin::CENTER ); - mBloomView.SetSize( viewSize ); + mBloomView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mBloomView.SetProperty( Actor::Property::SIZE, viewSize ); mRootActor.Add( mBloomView ); mBloomView.Activate(); Layer backgroundLayer = Layer::New(); - backgroundLayer.SetSize( viewSize ); - backgroundLayer.SetParentOrigin( ParentOrigin::CENTER ); + backgroundLayer.SetProperty( Actor::Property::SIZE, viewSize ); + backgroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBloomView.Add( backgroundLayer ); // Create the background image ImageView backgroundImage = ImageView::New( BACKGROUND_IMAGE_PATH ); - backgroundImage.SetParentOrigin( ParentOrigin::CENTER ); - backgroundImage.SetSize( viewSize ); + backgroundImage.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + backgroundImage.SetProperty( Actor::Property::SIZE, viewSize ); backgroundLayer.Add( backgroundImage ); Layer foregroundLayer = Layer::New(); - foregroundLayer.SetSize( viewSize ); - foregroundLayer.SetParentOrigin( ParentOrigin::CENTER ); + foregroundLayer.SetProperty( Actor::Property::SIZE, viewSize ); + foregroundLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mBloomView.Add( foregroundLayer ); // Create visible actors mObjectRootActor = Actor::New(); - mObjectRootActor.SetParentOrigin( ParentOrigin::CENTER ); - mObjectRootActor.SetSize( viewSize ); + mObjectRootActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mObjectRootActor.SetProperty( Actor::Property::SIZE, viewSize ); foregroundLayer.Add( mObjectRootActor ); ImageView imageView = ImageView::New( UI_DIFFUSE_IMAGE ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); - imageView.SetSize( viewSize ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::SIZE, viewSize ); mObjectRootActor.Add( imageView ); imageView = ImageView::New( UI_DIFFUSE_IMAGE ); - imageView.SetParentOrigin( ParentOrigin::CENTER ); - imageView.SetSize( stageSize * 0.5f ); - imageView.SetPosition( 0.0f, 0.0f, 100.0f ); + imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + imageView.SetProperty( Actor::Property::SIZE, windowSize * 0.5f ); + imageView.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 100.0f ) ); mObjectRootActor.Add( imageView ); AnimateBloomView(); PulseBloomIntensity(); // Respond to key events - stage.KeyEventSignal().Connect( this, &BloomExample::OnKeyEvent ); + window.KeyEventSignal().Connect( this, &BloomExample::OnKeyEvent ); } void OnKeyEvent( const KeyEvent& event ) { - if( event.state == KeyEvent::Down ) + if( event.GetState() == KeyEvent::DOWN ) { if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) { @@ -161,7 +161,7 @@ public: // ROTATE mRotationAnimation = Animation::New( 5.0f ); mRotationAnimation.AnimateBy( Property( mObjectRootActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT ); - mRotationAnimation.SetEndAction( Animation::Discard ); + mRotationAnimation.SetEndAction( Animation::DISCARD ); mRotationAnimation.SetLooping( true ); mRotationAnimation.Play(); @@ -170,7 +170,7 @@ public: mTranslationAnimation.AnimateBy( Property(mObjectRootActor, Actor::Property::POSITION), Vector3(100.0f, 0.0f, 0.0f), AlphaFunction::BOUNCE, TimePeriod(2.5f) ); mTranslationAnimation.AnimateBy( Property(mObjectRootActor, Actor::Property::POSITION), Vector3(300.0f, 0.0f, 0.0f), AlphaFunction::BOUNCE, TimePeriod(2.5f, 2.5f) ); mTranslationAnimation.AnimateBy( Property(mObjectRootActor, Actor::Property::POSITION), Vector3(0.0f, 0.0f, 0.0f), AlphaFunction::BOUNCE, TimePeriod(5.0f, 2.5f) ); - mTranslationAnimation.SetEndAction( Animation::Discard ); + mTranslationAnimation.SetEndAction( Animation::DISCARD ); mTranslationAnimation.SetLooping( true ); //mTranslationAnimation.Play(); @@ -178,7 +178,7 @@ public: mBlurAnimation = Animation::New( 4.0f ); mBlurAnimation.AnimateTo( Property( mBloomView, mBloomView.GetBlurStrengthPropertyIndex() ), 0.0f, AlphaFunction::LINEAR, TimePeriod(0.0f, 0.5f) ); mBlurAnimation.AnimateTo( Property( mBloomView, mBloomView.GetBlurStrengthPropertyIndex() ), 1.0f, AlphaFunction::LINEAR, TimePeriod(2.0f, 0.5f) ); - mBlurAnimation.SetEndAction( Animation::Discard ); + mBlurAnimation.SetEndAction( Animation::DISCARD ); mBlurAnimation.SetLooping( true ); mBlurAnimation.Play(); } @@ -187,7 +187,7 @@ public: { mPulseBloomIntensityAnim = Animation::New( 2.5f ); mPulseBloomIntensityAnim.AnimateTo( Property(mBloomView, mBloomView.GetBloomIntensityPropertyIndex()), 3.0f, AlphaFunction::BOUNCE, TimePeriod(2.5f) ); - mPulseBloomIntensityAnim.SetEndAction( Animation::Discard ); + mPulseBloomIntensityAnim.SetEndAction( Animation::DISCARD ); mPulseBloomIntensityAnim.SetLooping( true ); mPulseBloomIntensityAnim.Play(); }