From 5c9555a60b04f325838d9263eb7c981906503b33 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 31 Mar 2015 11:03:30 +0900 Subject: [PATCH] Remove non-public APIs of Animation Change-Id: Idc8fc2369f01eb7cb96635d15c1600fa3c368934 --- demo/dali-table-view.cpp | 14 +++++++------- examples/animated-shapes/animated-shapes-example.cpp | 4 ++-- examples/dissolve-effect/dissolve-effect-example.cpp | 4 ++-- .../image-scaling-irregular-grid-example.cpp | 2 +- examples/motion-blur/motion-blur-example.cpp | 15 ++++++++------- examples/motion-stretch/motion-stretch-example.cpp | 15 ++++++++------- examples/radial-menu/radial-menu-example.cpp | 4 ++-- examples/radial-menu/radial-sweep-view-impl.cpp | 10 +++++----- examples/scroll-view/scroll-view-example.cpp | 4 ++-- 9 files changed, 37 insertions(+), 35 deletions(-) diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index c825afe..f0992f4 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -502,8 +502,8 @@ void DaliTableView::Rotate( unsigned int degrees ) } mRotateAnimation = Animation::New( ROTATE_ANIMATION_TIME ); - mRotateAnimation.RotateTo( mRootActor, Degree( 360 - degrees ), Vector3::ZAXIS, AlphaFunctions::EaseOut ); - mRotateAnimation.Resize( mRootActor, targetSize, AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mRootActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 - degrees ) ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mRootActor, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseOut ); mRotateAnimation.Play(); } @@ -622,10 +622,10 @@ bool DaliTableView::OnTilePressed( Actor actor, const TouchEvent& event ) // scale the content actor within the Tile, as to not affect the placement within the Table. Actor content = actor.GetChildAt(0); - mPressedAnimation.ScaleTo( content, Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunctions::EaseInOut, 0.0f, - BUTTON_PRESS_ANIMATION_TIME * 0.5f ); - mPressedAnimation.ScaleTo( content, Vector3::ONE, AlphaFunctions::EaseInOut, BUTTON_PRESS_ANIMATION_TIME * 0.5f, - BUTTON_PRESS_ANIMATION_TIME * 0.5f ); + mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunctions::EaseInOut, + TimePeriod( 0.0f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) ); + mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3::ONE, AlphaFunctions::EaseInOut, + TimePeriod( BUTTON_PRESS_ANIMATION_TIME * 0.5f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) ); mPressedAnimation.Play(); mPressedAnimation.FinishedSignal().Connect( this, &DaliTableView::OnPressedAnimationFinished ); } @@ -791,7 +791,7 @@ void DaliTableView::InitialiseBackgroundActors( Actor actor ) // Kickoff animation Animation animation = Animation::New( Random::Range( 40.0f, 80.0f ) ); - animation.MoveBy( child, Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunctions::Linear ); + animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunctions::Linear ); animation.SetLooping( true ); animation.Play(); mBackgroundAnimations.push_back( animation ); diff --git a/examples/animated-shapes/animated-shapes-example.cpp b/examples/animated-shapes/animated-shapes-example.cpp index f73c796..fa98009 100644 --- a/examples/animated-shapes/animated-shapes-example.cpp +++ b/examples/animated-shapes/animated-shapes-example.cpp @@ -162,7 +162,7 @@ public: k0.Add( 1.0f, Vector3( -radius, 0.0f, 0.0f) ); animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunctions::EaseInOutSine ); - animation.RotateBy(meshActor,Degree(90.0f), Vector3::ZAXIS ); + animation.AnimateBy( Property( meshActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(90.0f) ), Vector3::ZAXIS ) ); animation.SetLooping( true ); animation.Play(); } @@ -343,7 +343,7 @@ public: k0.Add( 1.0f, Vector3( -radius*2.0, 0.0f, 0.0f) ); animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunctions::EaseInOutSine ); - animation.RotateBy(meshActor,Degree(-90.0f), Vector3::ZAXIS ); + animation.AnimateBy( Property( meshActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(-90.0f) ), Vector3::ZAXIS ) ); animation.SetLooping( true ); animation.Play(); } diff --git a/examples/dissolve-effect/dissolve-effect-example.cpp b/examples/dissolve-effect/dissolve-effect-example.cpp index ac4e699..cb65c7d 100644 --- a/examples/dissolve-effect/dissolve-effect-example.cpp +++ b/examples/dissolve-effect/dissolve-effect-example.cpp @@ -303,7 +303,7 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement) mAnimation.AnimateTo( Property(mCurrentImageEffect, mCurrentImageEffect.GetDistortionPropertyName()), 1.0f, AlphaFunctions::Linear ); mNextImage.SetOpacity(0.0f); - mAnimation.OpacityTo( mNextImage, 1.0, AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::Linear ); if(mUseHighPrecision) { @@ -314,7 +314,7 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement) } else { - mAnimation.MoveTo(mNextImage, Vector3(0.0f, 0.0f, 0.0f), AlphaFunctions::Linear); + mAnimation.AnimateTo( Property( mNextImage, Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), AlphaFunctions::Linear ); } mAnimation.FinishedSignal().Connect( this, &DissolveEffectApp::OnTransitionCompleted ); diff --git a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index 6b14053..3b9e0df 100644 --- a/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -468,7 +468,7 @@ public: { // Spin the image a few times: Animation animation = Animation::New(SPIN_DURATION); - animation.RotateBy( actor, Degree(360.0f * SPIN_DURATION), Vector3::XAXIS, AlphaFunctions::EaseOut); + animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f * SPIN_DURATION) ), Vector3::XAXIS ), AlphaFunctions::EaseOut ); animation.Play(); // Change the scaling mode: diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index 02032c7..2e695b4 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -326,8 +326,9 @@ public: { // has parent so we expect it to be on stage, start animation mRotateAnimation = Animation::New( ORIENTATION_DURATION ); - mRotateAnimation.RotateTo( mView, Degree( -orientation ), Vector3::ZAXIS, AlphaFunctions::EaseOut ); - mRotateAnimation.Resize( mView, targetSize.width, targetSize.height ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height ); mRotateAnimation.Play(); } else @@ -386,7 +387,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionBlurImageActor, Degree(720), Vector3::YAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -397,7 +398,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionBlurImageActor, Degree(720), Vector3::ZAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -408,8 +409,8 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionBlurImageActor, Degree(360), Vector3::YAXIS, AlphaFunctions::EaseInOut); - mActorAnimation.RotateBy(mMotionBlurImageActor, Degree(360), Vector3::ZAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunctions::EaseInOut ); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -420,7 +421,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.ScaleBy(mMotionBlurImageActor, Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, 0.0f, 1.0f); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, TimePeriod( 0.0f, 1.0f ) ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index a7fc7d4..7d22589 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -218,8 +218,9 @@ public: { // has parent so we expect it to be on stage, start animation mRotateAnimation = Animation::New( ORIENTATION_DURATION ); - mRotateAnimation.RotateTo( mView, Degree( -orientation ), Vector3::ZAXIS, AlphaFunctions::EaseOut ); - mRotateAnimation.Resize( mView, targetSize.width, targetSize.height ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height ); mRotateAnimation.Play(); } else @@ -277,7 +278,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionStretchImageActor, Degree(720), Vector3::YAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -288,7 +289,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionStretchImageActor, Degree(720), Vector3::ZAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -299,8 +300,8 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.RotateBy(mMotionStretchImageActor, Degree(360), Vector3::YAXIS, AlphaFunctions::EaseInOut); - mActorAnimation.RotateBy(mMotionStretchImageActor, Degree(360), Vector3::ZAXIS, AlphaFunctions::EaseInOut); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunctions::EaseInOut ); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -311,7 +312,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.ScaleBy(mMotionStretchImageActor, Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, 0.0f, 1.0f); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, TimePeriod( 0.0f, 1.0f ) ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } diff --git a/examples/radial-menu/radial-menu-example.cpp b/examples/radial-menu/radial-menu-example.cpp index f022eb0..1e54ced 100644 --- a/examples/radial-menu/radial-menu-example.cpp +++ b/examples/radial-menu/radial-menu-example.cpp @@ -189,8 +189,8 @@ void RadialMenuExample::StartAnimation() mRadialSweepView1.Activate(mAnimation, 0.0f, 3.0f); mRadialSweepView2.Activate(mAnimation, 1.5f, 3.0f); mRadialSweepView3.Activate(mAnimation, 3.0f, 3.0f); - mAnimation.OpacityTo(mDialActor, 1.0f, AlphaFunctions::EaseIn, 0.0f, 0.8f); - mAnimation.OpacityTo(mRadialSweepView1, 1.0f, AlphaFunctions::EaseIn, 0.0f, 0.5f); + mAnimation.AnimateTo( Property( mDialActor, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn, TimePeriod( 0.0f, 0.8f ) ); + mAnimation.AnimateTo( Property( mRadialSweepView1, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn, TimePeriod( 0.0f, 0.5f ) ); mAnimation.FinishedSignal().Connect( this, &RadialMenuExample::OnAnimationFinished ); mAnimationState = PLAYING; diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index 02a44b6..6289962 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -280,13 +280,13 @@ void RadialSweepViewImpl::Activate( Animation anim, float offsetTime, float dura Actor actor = mLayer.GetChildAt(i); if( actor != mStencilActor ) { - anim.RotateTo( actor, mInitialActorAngle, Vector3::ZAXIS ); + anim.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( mInitialActorAngle ) ), Vector3::ZAXIS ) ); } } } - anim.AnimateTo( Property( mStencilActor, mRotationAngleIndex ), static_cast(mFinalSector), mEasingFunction, TimePeriod( offsetTime, duration) ); - anim.RotateTo( mStencilActor, mFinalAngle, Vector3::ZAXIS, mEasingFunction, offsetTime, duration ); + anim.AnimateTo( Property( mStencilActor, mRotationAngleIndex ), static_cast(mFinalSector), mEasingFunction, TimePeriod( offsetTime, duration ) ); + anim.AnimateTo( Property( mStencilActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( mFinalAngle ) ), Vector3::ZAXIS ), mEasingFunction, TimePeriod( offsetTime, duration ) ); if( mRotateActorsWithStencil ) { @@ -295,7 +295,7 @@ void RadialSweepViewImpl::Activate( Animation anim, float offsetTime, float dura Actor actor = mLayer.GetChildAt(i); if( actor != mStencilActor ) { - anim.RotateTo( actor, Degree(mFinalAngle - mInitialAngle), Vector3::ZAXIS, mEasingFunction, offsetTime, duration ); + anim.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( mFinalAngle - mInitialAngle ) ), Vector3::ZAXIS ), mEasingFunction, TimePeriod( offsetTime, duration ) ); } } } @@ -306,7 +306,7 @@ void RadialSweepViewImpl::Activate( Animation anim, float offsetTime, float dura Actor actor = mLayer.GetChildAt(i); if( actor != mStencilActor ) { - anim.RotateTo( actor, mFinalActorAngle, Vector3::ZAXIS, mEasingFunction, offsetTime, duration ); + anim.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( mFinalActorAngle ) ), Vector3::ZAXIS ), mEasingFunction, TimePeriod( offsetTime, duration ) ); } } } diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index de3dfa4..d8d7fa1 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -141,7 +141,7 @@ const Vector3 ANCHOR_3DEFFECT_STYLE1(65.0f, -70.0f, -300.0f); ///< Rotation Anch const unsigned int IMAGE_THUMBNAIL_WIDTH = 256; ///< Width of Thumbnail Image in texels const unsigned int IMAGE_THUMBNAIL_HEIGHT = 256; ///< Height of Thumbnail Image in texels -const float SPIN_DURATION = 5.0f; ///< Times to spin an Image by upon touching, each spin taking a second. +const float SPIN_DURATION = 1.0f; ///< Times to spin an Image by upon touching, each spin taking a second. const float EFFECT_SNAP_DURATION(0.66f); ///< Scroll Snap Duration for Effects const float EFFECT_FLICK_DURATION(0.5f); ///< Scroll Flick Duration for Effects @@ -613,7 +613,7 @@ private: { // Spin the Image a few times. Animation animation = Animation::New(SPIN_DURATION); - animation.RotateBy( actor, Degree(360.0f * SPIN_DURATION), Vector3::XAXIS, AlphaFunctions::EaseOut); + animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f * SPIN_DURATION) ), Vector3::XAXIS ), AlphaFunctions::EaseOut ); animation.Play(); } } -- 2.7.4