From: Heeyong Song Date: Tue, 31 Mar 2015 02:02:07 +0000 (+0900) Subject: Remove non-public APIs of Animation X-Git-Tag: accepted/tizen/common/20150407.101646~5 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=18088175cb55711d4675c6ea25b1b01022886be5 Remove non-public APIs of Animation Change-Id: Ifd96224f116ad16b8d196cab198ebf1d23281198 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp index 4dcef68..0749da4 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp @@ -1010,7 +1010,7 @@ int UtcDaliAlignmentOnSizeAnimation(void) Stage::GetCurrent().Add(alignment); Animation animation = Animation::New(100.0f); - animation.Resize(alignment, Vector3(100.0f, 150.0f, 200.0f)); + animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) ); animation.Play(); application.Render(); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp index c0cf98c..3d0a489 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp @@ -505,7 +505,7 @@ int UtcDaliControlImplSizeAnimation(void) DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION ); Animation animation = Animation::New(1.0f); - animation.Resize(dummy, Vector3(100.0f, 150.0f, 200.0f)); + animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) ); animation.Play(); application.Render(); @@ -525,7 +525,7 @@ int UtcDaliControlImplSizeAnimation(void) Stage::GetCurrent().Add(dummy); Animation animation = Animation::New(1.0f); - animation.Resize(dummy, Vector3(100.0f, 150.0f, 200.0f)); + animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) ); animation.Play(); application.Render(); diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.cpp b/dali-toolkit/internal/controls/buttons/push-button-impl.cpp index c96d56d..b172a18 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.cpp @@ -1104,14 +1104,14 @@ Actor& PushButton::GetFadeOutBackgroundImage() return mFadeOutBackgroundContent; } -void PushButton::AddToFadeInAnimation( const Actor& actor ) +void PushButton::AddToFadeInAnimation( Actor& actor ) { if( !mFadeInAnimation ) { mFadeInAnimation = Dali::Animation::New( GetAnimationTime() ); } - mFadeInAnimation.OpacityTo( actor, 1.f ); + mFadeInAnimation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), 1.f ); } void PushButton::StartFadeInAnimation() @@ -1132,14 +1132,14 @@ void PushButton::StopFadeInAnimation() } } -void PushButton::AddToFadeOutAnimation( const Actor& actor ) +void PushButton::AddToFadeOutAnimation( Actor& actor ) { if( !mFadeOutAnimation ) { mFadeOutAnimation = Dali::Animation::New( GetAnimationTime() ); } - mFadeOutAnimation.OpacityTo( actor, 0.f ); + mFadeOutAnimation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), 0.f ); } void PushButton::StartFadeOutAnimation() diff --git a/dali-toolkit/internal/controls/buttons/push-button-impl.h b/dali-toolkit/internal/controls/buttons/push-button-impl.h index 89bce4b..cee57f6 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-impl.h +++ b/dali-toolkit/internal/controls/buttons/push-button-impl.h @@ -165,7 +165,7 @@ private: * Adds the actor to the fade in animation. It creates a fade in animation if needed. * @param[in] actor The actor. */ - void AddToFadeInAnimation( const Actor& actor ); + void AddToFadeInAnimation( Actor& actor ); /** * Starts the fade in animation. @@ -181,7 +181,7 @@ private: /** * Adds the actor to the fade out animation. It creates a fade out animation if needed. */ - void AddToFadeOutAnimation( const Actor& actor ); + void AddToFadeOutAnimation( Actor& actor ); /** * Starts the fade out animation. diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp index 1084302..4974ce1 100644 --- a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp +++ b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp @@ -295,8 +295,8 @@ void ClusterStyle::Apply( Actor actor, if( animationDuration > 0.f ) { Animation animation = Animation::New(animationDuration); - animation.MoveTo( actor, position, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); - animation.Resize( actor, size, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); animation.Play(); } else @@ -318,10 +318,10 @@ void ClusterStyle::Apply( Actor actor, if( animationDuration > 0.f ) { Animation animation = Animation::New(animationDuration); - animation.MoveTo( actor, position, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); - animation.Resize( actor, size, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); - animation.RotateTo( actor, rotation, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); - animation.ScaleTo( actor, scale, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds ); + animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); + animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), rotation, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); + animation.AnimateTo( Property( actor, Actor::Property::SCALE ), scale, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) ); animation.Play(); } else diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp index 91fb19f..84eb4e4 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp @@ -264,11 +264,12 @@ void NavigationControl::OrientationChanged( int angle ) } } + Actor self = Self(); Animation animation = Animation::New( mOrientationAnimationDuration ); - animation.RotateTo( Self(), Degree( -angle ), Vector3::ZAXIS, mOrientationAnimationAlphaFunc ); + animation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::ZAXIS ), mOrientationAnimationAlphaFunc ); animation.Play(); - Self().SetSize( targetSize ); + self.SetSize( targetSize ); RelayoutRequest(); } diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index bae2b78..cd3a764 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -250,6 +250,8 @@ void ScrollBar::OnScrollPositionNotified(PropertyNotification& source) void ScrollBar::Show() { + Actor self = Self(); + // Cancel any animation if(mAnimation) { @@ -260,17 +262,19 @@ void ScrollBar::Show() if(mIndicatorShowDuration > 0.0f) { mAnimation = Animation::New( mIndicatorShowDuration ); - mAnimation.OpacityTo( Self(), 1.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn ); mAnimation.Play(); } else { - Self().SetOpacity(1.0f); + self.SetOpacity(1.0f); } } void ScrollBar::Hide() { + Actor self = Self(); + // Cancel any animation if(mAnimation) { @@ -281,12 +285,12 @@ void ScrollBar::Hide() if(mIndicatorHideDuration > 0.0f) { mAnimation = Animation::New( mIndicatorHideDuration ); - mAnimation.OpacityTo( Self(), 0.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn ); mAnimation.Play(); } else { - Self().SetOpacity(0.0f); + self.SetOpacity(0.0f); } } diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp index 1dfced0..3b188df 100755 --- a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp @@ -558,8 +558,8 @@ void ScrollBarInternal::Show() } mAnimation = Animation::New( BAR_SHOW_TIME ); - mAnimation.OpacityTo( mSlider, 1.0f, AlphaFunctions::EaseIn ); - mAnimation.OpacityTo( mSliderWrap, 1.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn ); mAnimation.Play(); DestructTimer(); @@ -575,8 +575,8 @@ void ScrollBarInternal::Hide() } mAnimation = Animation::New( BAR_HIDE_TIME ); - mAnimation.OpacityTo( mSlider, 0.0f, AlphaFunctions::EaseIn ); - mAnimation.OpacityTo( mSliderWrap, 0.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn ); mAnimation.Play(); } diff --git a/dali-toolkit/internal/controls/view/view-impl.cpp b/dali-toolkit/internal/controls/view/view-impl.cpp index a1d0c09..3cb58ac 100644 --- a/dali-toolkit/internal/controls/view/view-impl.cpp +++ b/dali-toolkit/internal/controls/view/view-impl.cpp @@ -168,6 +168,8 @@ void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree por void View::OrientationChanged( Dali::Orientation orientation ) { + Actor self = Self(); + // Nothing to do if orientation doesn't really change. if ( orientation.GetDegrees() == mOrientation || !mAutoRotateEnabled ) { @@ -178,13 +180,13 @@ void View::OrientationChanged( Dali::Orientation orientation ) // has parent so we expect it to be on stage mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION ); - mRotateAnimation.RotateTo( Self(), Degree( -orientation.GetDegrees() ), Vector3::ZAXIS, AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( -orientation.GetRadians(), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); // Resize the view if( mFullScreen ) { const Vector2& stageSize( Stage::GetCurrent().GetSize() ); - const Vector3& currentSize( Self().GetCurrentSize() ); + const Vector3& currentSize( self.GetCurrentSize() ); float minSize = std::min( stageSize.width, stageSize.height ); float maxSize = std::max( stageSize.width, stageSize.height ); @@ -214,15 +216,15 @@ void View::OrientationChanged( Dali::Orientation orientation ) { // width grows, shrink height faster Vector3 shrink( currentSize );shrink.height = targetSize.height; - mRotateAnimation.Resize( Self(), shrink, AlphaFunctions::EaseOut, 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ); - mRotateAnimation.Resize( Self(), targetSize, AlphaFunctions::EaseIn, 0.0f, ROTATION_ANIMATION_DURATION ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) ); } else { // height grows, shrink width faster Vector3 shrink( currentSize );shrink.width = targetSize.width; - mRotateAnimation.Resize( Self(), shrink, AlphaFunctions::EaseOut, 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ); - mRotateAnimation.Resize( Self(), targetSize, AlphaFunctions::EaseIn, 0.0f, ROTATION_ANIMATION_DURATION ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) ); + mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) ); } } diff --git a/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp index 975889d..5a0188a 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp @@ -127,11 +127,11 @@ void CubeTransitionCrossEffect::SetupAnimation(unsigned int actorIndex, float an mTiles[mContainerIndex][actorIndex].TranslateBy( resetTranslation ); mTiles[mContainerIndex][actorIndex].SetOrientation( Radian( angle), axis ); } - mAnimation.RotateTo( mBoxes[actorIndex], Radian( -angle ), axis, AlphaFunctions::EaseInOutSine ); + mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), axis ), AlphaFunctions::EaseInOutSine ); Vector3 position(mBoxes[actorIndex].GetCurrentPosition()); - mAnimation.MoveTo(mBoxes[actorIndex], position*mDisplacementRatio+Vector3(0.f,0.f,mCubeDisplacement), AlphaFunctions::Bounce); - mAnimation.ColorTo( mTiles[mContainerIndex^1][actorIndex], HALF_BRIGHTNESS, AlphaFunctions::EaseOut ); - mAnimation.ColorTo( mTiles[mContainerIndex][actorIndex], FULL_BRIGHTNESS, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::POSITION ), position * mDisplacementRatio + Vector3( 0.f, 0.f, mCubeDisplacement ), AlphaFunctions::Bounce ); + mAnimation.AnimateTo( Property( mTiles[mContainerIndex^1][actorIndex], Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property( mTiles[mContainerIndex][actorIndex], Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn ); } } // namespace Internal diff --git a/dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp index abffa6a..37a3a06 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp @@ -125,11 +125,11 @@ void CubeTransitionFoldEffect::SetupAnimation(unsigned int actorIndex, float ang sideTile.TranslateBy( resetTranslation ); sideTile.SetOrientation( Radian( angle), Vector3::YAXIS ); } - mAnimation.RotateTo( currentCube, Radian( -angle ), Vector3::YAXIS, AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property( currentCube, Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), Vector3::YAXIS ), AlphaFunctions::Linear ); Vector3 position(currentCube.GetCurrentPosition()); - mAnimation.MoveTo(currentCube, Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunctions::Bounce); - mAnimation.ColorTo( frontTile, HALF_BRIGHTNESS, AlphaFunctions::EaseOut ); - mAnimation.ColorTo( sideTile, FULL_BRIGHTNESS, AlphaFunctions::EaseIn ); + mAnimation.AnimateTo( Property( currentCube, Actor::Property::POSITION ), Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunctions::Bounce ); + mAnimation.AnimateTo( Property( frontTile, Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property( sideTile, Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn ); } } // namespace Internal diff --git a/dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp b/dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp index 1f8ca0f..1b0063d 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp +++ b/dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp @@ -97,14 +97,14 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p // the delay value is within 0.f ~ 2.f*thirdAnimationDuration float delay = thirdAnimationDuration * CalculateDelay(x*mTileSize.width,y*mTileSize.height); - mAnimation.RotateTo( mBoxes[idx], Degree( -angle ), Vector3::YAXIS, - AlphaFunctions::EaseOutSine, delay, thirdAnimationDuration ); - mAnimation.MoveBy( mBoxes[idx], Vector3(0.f,0.f,-mCubeDisplacement), - AlphaFunctions::Bounce, delay, thirdAnimationDuration ); - mAnimation.ColorTo( mTiles[anotherIndex][idx], HALF_BRIGHTNESS, - AlphaFunctions::EaseOut, delay, thirdAnimationDuration ); - mAnimation.ColorTo( mTiles[mContainerIndex][idx], FULL_BRIGHTNESS, - AlphaFunctions::EaseIn, delay, thirdAnimationDuration ); + mAnimation.AnimateTo( Property( mBoxes[idx], Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::YAXIS ), + AlphaFunctions::EaseOutSine, TimePeriod( delay, thirdAnimationDuration ) ); + mAnimation.AnimateBy( Property( mBoxes[idx], Actor::Property::POSITION ), Vector3( 0.f, 0.f, -mCubeDisplacement ), + AlphaFunctions::Bounce, TimePeriod( delay, thirdAnimationDuration ) ); + mAnimation.AnimateTo( Property( mTiles[anotherIndex][idx], Actor::Property::COLOR ), HALF_BRIGHTNESS, + AlphaFunctions::EaseOut, TimePeriod( delay, thirdAnimationDuration ) ); + mAnimation.AnimateTo( Property( mTiles[mContainerIndex][idx], Actor::Property::COLOR ), FULL_BRIGHTNESS, + AlphaFunctions::EaseIn, TimePeriod( delay, thirdAnimationDuration ) ); } } diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp index cce79c0..564235c 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp @@ -575,7 +575,7 @@ void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 { if(animation) { - animation.Resize(actor, size); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size ); } } diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp index efb16e2..93e9956 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp @@ -624,8 +624,8 @@ void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 s // Do a nonlinear size animation to shrink the actor first when the actor size changes, // so that we can avoid the actors overlapping during orientation change. - animation.Resize( actor, shrink, AlphaFunctions::EaseOut, 0.0f, durationSeconds * 0.5f ); - animation.Resize( actor, size, AlphaFunctions::EaseIn, 0.0f, durationSeconds ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, durationSeconds * 0.5f ) ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunctions::EaseIn, TimePeriod( 0.0f, durationSeconds ) ); } } diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp index 471574c..07b5a78 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp @@ -489,7 +489,7 @@ void SpiralLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 { if(animation) { - animation.Resize(actor, size); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size ); } } diff --git a/docs/content/programming-guide/animation-example.h b/docs/content/programming-guide/animation-example.h index 577dcfe..d133614 100644 --- a/docs/content/programming-guide/animation-example.h +++ b/docs/content/programming-guide/animation-example.h @@ -20,8 +20,8 @@ Here we add the animators, these are the building blocks (functions) of the animation and define what we want to see @code - myAnimation.OpacityTo(actor, 1.0f); - myAnimation.MoveTo(actor, x, y, z); + myAnimation.AnimateTo(Property(actor, Actor::Property::OPACITY), 1.0f); + myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z)); @endcode start animation, when this is called we want the animation to start playing so here the actor will move whilst the opacity changes. @@ -30,15 +30,13 @@ @endcode \section advanced-anims Adding more advanced animators, if simply moving the actor is not enough we have further animations methods. - For actor there exists a range of methods ranging from Move, Rotate, Scale, Opacity, Color to Resize. The API explains in detail what each does and the parameters to these methods but there are some points worth noting; - - xxxxBy and xxxxTo, method names are appended by 'By' or 'To' either animate to a supplied value or animate by a supplied value. For example an actor at (10,10,10) calling MoveBy(actor, 50,0,0) would mean its location is (60,0,0) whilst MoveTo(actor, 50,0,0) would result in a location (50,0,0). + AnimateBy and AnimateTo, method names are appended by 'By' or 'To' either animate to a supplied value or animate by a supplied value. For example an actor at (10,10,10) calling AnimateBy(Property(actor, Actor::Property::POSITION), 50,0,0) would mean its location is (60,0,0) whilst AnimateTo(Property(actor, Actor::Property::POSITION), 50,0,0) would result in a location (50,0,0). Dali::AlphaFunctions can be used to give interesting effects to the animation, for example the MOVEment of an actor on screen can speed up and slow down following a sine curve by using the Dali::AlphaFunctions::EaseInOutSine instead of AlphaFunctions::Linear. @code - myAnimation.MoveTo(actor, Vector3(x, y, z), AlphaFunctions::Linear, delay, ANIMATOR_DURATION); - myAnimation.Resize(actor, actorSize, AlphaFunctions::EaseIn, delay, ANIMATOR_DURATION); + myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z), AlphaFunctions::Linear, delay, ANIMATOR_DURATION); + myAnimation.AnimateTo(Property(actor, Actor::Property::SIZE), actorSize, AlphaFunctions::EaseIn, delay, ANIMATOR_DURATION); @endcode \section playback-control Controlling a playing animation diff --git a/docs/content/programming-guide/animation-rotation.h b/docs/content/programming-guide/animation-rotation.h index 2e01044..0351ec9 100644 --- a/docs/content/programming-guide/animation-rotation.h +++ b/docs/content/programming-guide/animation-rotation.h @@ -15,19 +15,15 @@ * actor.RotateBy(q); * @endcode * - * The Dali::Animation class provides several RotateTo methods that - * use \ref Dali::Quaternion "Quaternions" directly. The other - * RotateTo methods are specified using Axis+Angle, and these convert - * to Quaternion internally. You will only need to use the quaternion - * based methods when you are doing something more complex than - * initialising with Axis+Angle, such as applying several rotations - * together. + * The Dali::Animation class provides several AnimateTo methods that + * use \ref Dali::Quaternion "Quaternions" directly to change the orientation. + * * @code * mAnimation = Animation::New(5.0f); // 5 seconds * Quaternion q(Radian(Degree(45.0f)).value, Vector3::YAXIS); * Quaternion r(Radian(Degree(30.0f)).value, Vector3::ZAXIS); * q *= r; - * mAnimation.RotateTo(mActor, q, AlphaFunctions::EaseInOut); + * mAnimation.AnimateTo(Property(mActor, Actor::Property::ORIENTATION), q, AlphaFunctions::EaseInOut); * mAnimation.Play(); * @endcode */ diff --git a/docs/content/programming-guide/dynamics-bodies.h b/docs/content/programming-guide/dynamics-bodies.h index a8a9200..a6761d5 100644 --- a/docs/content/programming-guide/dynamics-bodies.h +++ b/docs/content/programming-guide/dynamics-bodies.h @@ -125,7 +125,7 @@ * body.SetKinematic( true ); * // create a second animation to move the actor 100 units to the right * Animation animation( Animation::New( 1 ) ); - * animation.MoveBy( actor, Vector3( 100, 0, 0 ), AlphaFunctions::Linear ); + * animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( 100, 0, 0 ), AlphaFunctions::Linear ); * animation.Play(); * \endcode *