From c9273e4023e21144a0b609aa090fe51ec706a45f Mon Sep 17 00:00:00 2001 From: Ferran Sole Date: Mon, 20 Apr 2015 14:48:12 +0100 Subject: [PATCH] Alpha function changes --- demo/dali-table-view.cpp | 10 +++++----- examples/animated-shapes/animated-shapes-example.cpp | 22 +++++++++++----------- examples/blocks/blocks-example.cpp | 10 +++++----- examples/buttons/buttons-example.cpp | 2 +- examples/cluster/cluster-impl.cpp | 34 +++++++++++++++++----------------- examples/cluster/cluster-style.cpp | 6 +++--- examples/cluster/cluster-style.h | 2 +- examples/cluster/cluster.h | 2 +- examples/dissolve-effect/dissolve-effect-example.cpp | 8 ++++---- examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp | 2 +- examples/item-view/item-view-example.cpp | 6 +++--- examples/logging/logging-example.cpp | 2 +- examples/magnifier/magnifier-example.cpp | 4 ++-- examples/motion-blur/motion-blur-example.cpp | 14 +++++++------- examples/motion-stretch/motion-stretch-example.cpp | 14 +++++++------- examples/radial-menu/radial-menu-example.cpp | 6 +++--- examples/radial-menu/radial-sweep-view-impl.cpp | 6 ++++-- examples/scroll-view/scroll-view-example.cpp | 22 +++++++++++----------- examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp | 2 +- examples/text-label-emojis/text-label-emojis.cpp | 2 +- examples/text-label-multi-language/text-label-multi-language-example.cpp | 2 +- 21 files changed, 90 insertions(+), 88 deletions(-) diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index c1b7f6b..cb56cd5 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -479,8 +479,8 @@ void DaliTableView::Rotate( unsigned int degrees ) } mRotateAnimation = Animation::New( ROTATE_ANIMATION_TIME ); - 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.AnimateTo( Property( mRootActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 - degrees ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT ); + mRotateAnimation.AnimateTo( Property( mRootActor, Actor::Property::SIZE ), targetSize, AlphaFunction::EASE_OUT ); mRotateAnimation.Play(); } @@ -592,9 +592,9 @@ 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.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunctions::EaseInOut, + mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3( 0.9f, 0.9f, 1.0f ), AlphaFunction::EASE_IN_OUT, TimePeriod( 0.0f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) ); - mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3::ONE, AlphaFunctions::EaseInOut, + mPressedAnimation.AnimateTo( Property( content, Actor::Property::SCALE ), Vector3::ONE, AlphaFunction::EASE_IN_OUT, TimePeriod( BUTTON_PRESS_ANIMATION_TIME * 0.5f, BUTTON_PRESS_ANIMATION_TIME * 0.5f ) ); mPressedAnimation.Play(); mPressedAnimation.FinishedSignal().Connect( this, &DaliTableView::OnPressedAnimationFinished ); @@ -759,7 +759,7 @@ void DaliTableView::InitialiseBackgroundActors( Actor actor ) // Kickoff animation Animation animation = Animation::New( Random::Range( 40.0f, 80.0f ) ); - animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunctions::Linear ); + animation.AnimateBy( Property( child, Actor::Property::POSITION ), Vector3( 0.0f, -1.0f, 0.0f ), AlphaFunction::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 e36d9e5..0c59827 100644 --- a/examples/animated-shapes/animated-shapes-example.cpp +++ b/examples/animated-shapes/animated-shapes-example.cpp @@ -143,25 +143,25 @@ public: k0.Add( 0.0f, Vector3( 0.0f,-radius, 0.0f) ); k0.Add( 0.5f, Vector3(0.0f, -radius*4.0f, 0.0f)); k0.Add( 1.0f, Vector3( 0.0f,-radius, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3( radius, 0.0f, 0.0f) ); k0.Add( 0.5f, Vector3(radius*4.0f,0.0f, 0.0f)); k0.Add( 1.0f, Vector3( radius,0.0f, 0.0f)); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3(0.0f,radius, 0.0f) ); k0.Add( 0.5f, Vector3(0.0f,radius*4.0f, 0.0f)); k0.Add( 1.0f, Vector3(0.0f,radius, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3( -radius, 0.0f, 0.0f) ); k0.Add( 0.5f, Vector3(-radius*4.0f,0.0f, 0.0f)); k0.Add( 1.0f, Vector3( -radius, 0.0f, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunction::EASE_IN_OUT ); animation.AnimateBy( Property( meshActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(90.0f) ), Vector3::ZAXIS ) ); animation.SetLooping( true ); @@ -244,19 +244,19 @@ public: k0.Add( 0.0f,v3 ); k0.Add( 0.5f, v3 + Vector3(-200.0f,-200.0f,0.0f)); k0.Add( 1.0f, v3 ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f,v4 ); k0.Add( 0.5f, v4 + Vector3(200.0f,-200.0f,0.0f)); k0.Add( 1.0f, v4 ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f,v5 ); k0.Add( 0.5f, v5 + Vector3(0.0,200.0f,0.0f)); k0.Add( 1.0f, v5 ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunction::EASE_IN_OUT ); animation.SetLooping( true ); animation.Play(); } @@ -324,25 +324,25 @@ public: k0.Add( 0.0f, Vector3( 0.0f,-radius*2.0, 0.0f) ); k0.Add( 0.5f, Vector3(-radius*2.0, -radius*3.0f, 0.0f)); k0.Add( 1.0f, Vector3( 0.0f,-radius*2.0, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(1)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3( radius*2.0, 0.0f, 0.0f) ); k0.Add( 0.5f, Vector3(radius*3.0f,-radius*2.0, 0.0f)); k0.Add( 1.0f, Vector3( radius*2.0,0.0f, 0.0f)); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(4)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3(0.0f,radius*2.0, 0.0f) ); k0.Add( 0.5f, Vector3(radius*2.0,radius*3.0f, 0.0f)); k0.Add( 1.0f, Vector3(0.0f,radius*2.0, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(7)),k0,AlphaFunction::EASE_IN_OUT ); k0 = KeyFrames::New(); k0.Add( 0.0f, Vector3( -radius*2.0, 0.0f, 0.0f) ); k0.Add( 0.5f, Vector3(-radius*3.0f,radius*2.0, 0.0f)); k0.Add( 1.0f, Vector3( -radius*2.0, 0.0f, 0.0f) ); - animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunctions::EaseInOutSine ); + animation.AnimateBetween( Property(shader, shader.GetPointPropertyName(10)),k0,AlphaFunction::EASE_IN_OUT ); animation.AnimateBy( Property( meshActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(-90.0f) ), Vector3::ZAXIS ) ); animation.SetLooping( true ); diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp index 35315df..23775b2 100644 --- a/examples/blocks/blocks-example.cpp +++ b/examples/blocks/blocks-example.cpp @@ -595,8 +595,8 @@ private: mDragActor = actor; mDragAnimation = Animation::New(0.25f); - mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.1f, 1.1f, 1.0f), AlphaFunctions::EaseOut); - mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 0.0f), AlphaFunctions::EaseOut); + mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.1f, 1.1f, 1.0f), AlphaFunction::EASE_OUT); + mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 0.0f), AlphaFunction::EASE_OUT); mDragAnimation.Play(); } } @@ -621,8 +621,8 @@ private: if(point.state==TouchPoint::Up) // Stop dragging { mDragAnimation = Animation::New(0.25f); - mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunctions::EaseIn); - mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f), AlphaFunctions::EaseOut); + mDragAnimation.AnimateTo( Property(mDragActor, Actor::Property::SCALE), Vector3(1.0f, 1.0f, 1.0f), AlphaFunction::EASE_IN); + mDragAnimation.AnimateTo( Property(mPaddleHandle, Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, 1.0f), AlphaFunction::EASE_OUT); mDragAnimation.Play(); mDragActor.Reset(); } @@ -764,7 +764,7 @@ private: // fade brick (destroy) Animation destroyAnimation = Animation::New(0.5f); - destroyAnimation.AnimateTo( Property( brick, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn ); + destroyAnimation.AnimateTo( Property( brick, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN ); destroyAnimation.Play(); destroyAnimation.FinishedSignal().Connect( this, &ExampleController::OnBrickDestroyed ); mDestroyAnimationMap[destroyAnimation] = brick; diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index 7395653..739d357 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -484,7 +484,7 @@ class ButtonsController: public ConnectionTracker { if( mAnimation ) { - mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); mAnimation.Play(); mLastPoint = localPoint; } diff --git a/examples/cluster/cluster-impl.cpp b/examples/cluster/cluster-impl.cpp index 2768d03..00b91f9 100644 --- a/examples/cluster/cluster-impl.cpp +++ b/examples/cluster/cluster-impl.cpp @@ -104,8 +104,8 @@ void Cluster::OnControlSizeSet( const Vector3& targetSize ) { mClusterStyle.ApplyStyle( (*iter).mActor, (*iter).mPositionIndex, - AlphaFunctions::EaseOut, - 0.f ); + AlphaFunction::EASE_OUT, + TimePeriod(0.f) ); } } @@ -175,7 +175,7 @@ void Cluster::AddChildInfoAt( ChildInfo childInfo, unsigned int index ) child.RemoveConstraints(); // apply new constraints to the child - mClusterStyle.ApplyStyle(child, childInfo.mPositionIndex, AlphaFunctions::EaseOut, 0.0f); + mClusterStyle.ApplyStyle(child, childInfo.mPositionIndex, AlphaFunction::EASE_OUT, TimePeriod(0.0f)); } else { @@ -293,8 +293,8 @@ void Cluster::ExpandChild( unsigned int index ) position, Vector3::ONE * scale, Quaternion(rotate, Vector3::ZAXIS), - AlphaFunctions::EaseOut, - 0.5f); + AlphaFunction::EASE_OUT, + TimePeriod(0.5f)); } } } @@ -312,8 +312,8 @@ void Cluster::CollapseChild( unsigned int index, bool front ) if( index < mChildren.size() ) { RestoreChild(index, - AlphaFunctions::EaseOut, - 0.25f, + AlphaFunction::EASE_OUT, + TimePeriod(0.25f), front); } } @@ -323,8 +323,8 @@ void Cluster::CollapseAllChildren( bool front ) for(unsigned int index = 0;index < mChildren.size(); index++) { RestoreChild(index, - AlphaFunctions::EaseOut, - 0.25f, + AlphaFunction::EASE_OUT, + TimePeriod(0.25f), front); } } @@ -344,9 +344,9 @@ void Cluster::TransformChild( unsigned int index, const Vector3& position, const child.RemoveConstraints(); Animation animation = Animation::New(period.delaySeconds + period.durationSeconds); - animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunctions::EaseOut, period); - animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunctions::EaseOut, period); - animation.AnimateTo( Property(child, Actor::Property::ORIENTATION), rotation, AlphaFunctions::EaseOut, period); + animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunction::EASE_OUT, period); + animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunction::EASE_OUT, period); + animation.AnimateTo( Property(child, Actor::Property::ORIENTATION), rotation, AlphaFunction::EASE_OUT, period); animation.Play(); } } @@ -435,8 +435,8 @@ void Cluster::SetStyle(Demo::ClusterStyle style) { mClusterStyle.ApplyStyle( (*iter).mActor, (*iter).mPositionIndex, - AlphaFunctions::EaseOut, - CLUSTER_STYLE_CONSTRAINT_DURATION ); + AlphaFunction::EASE_OUT, + TimePeriod(CLUSTER_STYLE_CONSTRAINT_DURATION) ); } } @@ -463,7 +463,7 @@ void Cluster::UpdateBackground(float duration) { if (mBackgroundImage) { - mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunctions::EaseOut, duration); + mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunction::EASE_OUT, TimePeriod(duration)); } } @@ -471,7 +471,7 @@ void Cluster::UpdateTitle(float duration) { if (mTitle) { - mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunctions::EaseOut, duration); + mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunction::EASE_OUT, TimePeriod(duration)); } } @@ -539,7 +539,7 @@ void Cluster::DoTransformAction(const PropertyValueContainer& attributes) // wrap index around -1 => size - 1 index%= mChildren.size(); - TransformChild(index, position, scale, rotation, AlphaFunctions::EaseOut, 0.5f); + TransformChild(index, position, scale, rotation, AlphaFunction::EASE_OUT, TimePeriod(0.5f)); } void Cluster::OnControlChildRemove(Actor& child) diff --git a/examples/cluster/cluster-style.cpp b/examples/cluster/cluster-style.cpp index 91c4c1c..6117d86 100644 --- a/examples/cluster/cluster-style.cpp +++ b/examples/cluster/cluster-style.cpp @@ -57,17 +57,17 @@ unsigned int ClusterStyle::GetMaximumNumberOfChildren() const void ClusterStyle::ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds) { - GetImpl(*this).ApplyStyle(child, index, alpha, durationSeconds); + GetImpl(*this).ApplyStyle(child, index, alpha, TimePeriod(durationSeconds)); } void ClusterStyle::ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds) { - GetImpl(*this).ApplyStyleToBackground(background, alpha, durationSeconds); + GetImpl(*this).ApplyStyleToBackground(background, alpha, TimePeriod(durationSeconds)); } void ClusterStyle::ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds) { - GetImpl(*this).ApplyStyleToTitle(title, alpha, durationSeconds); + GetImpl(*this).ApplyStyleToTitle(title, alpha, TimePeriod(durationSeconds)); } // ClusterStyleStandard /////////////////////////////////////////////////////// diff --git a/examples/cluster/cluster-style.h b/examples/cluster/cluster-style.h index ce2fabc..1e39ff7 100644 --- a/examples/cluster/cluster-style.h +++ b/examples/cluster/cluster-style.h @@ -20,7 +20,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include #include #include diff --git a/examples/cluster/cluster.h b/examples/cluster/cluster.h index 98015bd..07a08dc 100644 --- a/examples/cluster/cluster.h +++ b/examples/cluster/cluster.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include #include // INTERNAL INCLUDES diff --git a/examples/dissolve-effect/dissolve-effect-example.cpp b/examples/dissolve-effect/dissolve-effect-example.cpp index 9be4308..ebbe4c9 100644 --- a/examples/dissolve-effect/dissolve-effect-example.cpp +++ b/examples/dissolve-effect/dissolve-effect-example.cpp @@ -297,21 +297,21 @@ void DissolveEffectApp::StartTransition(Vector2 position, Vector2 displacement) mCurrentImageEffect.SetCentralLine(position,displacement); mCurrentImageEffect.SetDistortion(0.0f); mCurrentImage.SetShaderEffect(mCurrentImageEffect); - mAnimation.AnimateTo( Property(mCurrentImageEffect, mCurrentImageEffect.GetDistortionPropertyName()), 1.0f, AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property(mCurrentImageEffect, mCurrentImageEffect.GetDistortionPropertyName()), 1.0f, AlphaFunction::LINEAR ); mNextImage.SetOpacity(0.0f); - mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property( mNextImage, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::LINEAR ); if(mUseHighPrecision) { mNextImageEffect.SetCentralLine(position,-displacement); mNextImageEffect.SetDistortion(1.0f); mNextImage.SetShaderEffect(mNextImageEffect); - mAnimation.AnimateTo( Property(mNextImageEffect, mNextImageEffect.GetDistortionPropertyName()), 0.0f, AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property(mNextImageEffect, mNextImageEffect.GetDistortionPropertyName()), 0.0f, AlphaFunction::LINEAR ); } else { - mAnimation.AnimateTo( Property( mNextImage, Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), AlphaFunctions::Linear ); + mAnimation.AnimateTo( Property( mNextImage, Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), AlphaFunction::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 ced7828..d921645 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 @@ -465,7 +465,7 @@ public: { // Spin the image a few times: Animation animation = Animation::New(SPIN_DURATION); - animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( 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 ), AlphaFunction::EASE_OUT ); animation.Play(); // Change the scaling mode: diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 2fc3609..6a0a6e2 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -103,9 +103,9 @@ const unsigned int IMAGE_WIDTH = 256; const unsigned int IMAGE_HEIGHT = 256; const unsigned int NUM_IMAGE_PER_ROW_IN_ATLAS = 8; -AlphaFunction ALPHA_FUNCTIONS[] = { AlphaFunctions::Linear, - AlphaFunctions::EaseIn, - AlphaFunctions::EaseOut }; +AlphaFunction ALPHA_FUNCTIONS[] = { AlphaFunction(AlphaFunction::LINEAR), + AlphaFunction(AlphaFunction::EASE_IN), + AlphaFunction(AlphaFunction::EASE_OUT) }; const unsigned int NUM_ALPHA_FUNCTIONS = sizeof(ALPHA_FUNCTIONS) / sizeof(AlphaFunction); diff --git a/examples/logging/logging-example.cpp b/examples/logging/logging-example.cpp index f61a5c1..a37fcb4 100644 --- a/examples/logging/logging-example.cpp +++ b/examples/logging/logging-example.cpp @@ -700,7 +700,7 @@ class LoggingController: public ConnectionTracker { if( mAnimation ) { - mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); mAnimation.Play(); mLastPoint = localPoint; } diff --git a/examples/magnifier/magnifier-example.cpp b/examples/magnifier/magnifier-example.cpp index 2954cb9..08c107e 100644 --- a/examples/magnifier/magnifier-example.cpp +++ b/examples/magnifier/magnifier-example.cpp @@ -344,7 +344,7 @@ public: if(!mMagnifierShown) { Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION); - animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ONE, AlphaFunctions::EaseIn); + animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ONE, AlphaFunction::EASE_IN); animation.Play(); mMagnifierShown = true; } @@ -358,7 +358,7 @@ public: if(mMagnifierShown) { Animation animation = Animation::New(MAGNIFIER_DISPLAY_DURATION); - animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut); + animation.AnimateTo(Property(mMagnifier, Actor::Property::SCALE), Vector3::ZERO, AlphaFunction::EASE_OUT); animation.Play(); mMagnifierShown = false; } diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index b733c6d..ccc056c 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -322,7 +322,7 @@ public: { // has parent so we expect it to be on stage, start animation mRotateAnimation = Animation::New( ORIENTATION_DURATION ); - mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT ); mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width ); mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height ); mRotateAnimation.Play(); @@ -367,7 +367,7 @@ public: mActorTapMovementAnimation = Animation::New( animDuration ); if ( mMotionBlurImageActor ) { - mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageActor, Actor::Property::POSITION), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) ); + mActorTapMovementAnimation.AnimateTo( Property(mMotionBlurImageActor, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) ); } mActorTapMovementAnimation.SetEndAction( Animation::Bake ); mActorTapMovementAnimation.Play(); @@ -383,7 +383,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - 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::YAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -394,7 +394,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -405,8 +405,8 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - 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.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT ); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -417,7 +417,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, TimePeriod( 0.0f, 1.0f ) ); + mActorAnimation.AnimateBy( Property( mMotionBlurImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::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 570005e..b9c4a75 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -220,7 +220,7 @@ public: { // has parent so we expect it to be on stage, start animation mRotateAnimation = Animation::New( ORIENTATION_DURATION ); - mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunctions::EaseOut ); + mRotateAnimation.AnimateTo( Property( mView, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -orientation ) ), Vector3::ZAXIS ), AlphaFunction::EASE_OUT ); mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_WIDTH ), targetSize.width ); mRotateAnimation.AnimateTo( Property( mView, Actor::Property::SIZE_HEIGHT ), targetSize.height ); mRotateAnimation.Play(); @@ -264,7 +264,7 @@ public: mActorTapMovementAnimation = Animation::New( animDuration ); if ( mMotionStretchImageActor ) { - mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageActor, Actor::Property::POSITION), destPos, AlphaFunctions::EaseInOutSine, TimePeriod(animDuration) ); + mActorTapMovementAnimation.AnimateTo( Property(mMotionStretchImageActor, Actor::Property::POSITION), destPos, AlphaFunction::EASE_IN_OUT_SINE, TimePeriod(animDuration) ); } mActorTapMovementAnimation.SetEndAction( Animation::Bake ); mActorTapMovementAnimation.Play(); @@ -280,7 +280,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - 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::YAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -291,7 +291,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunctions::EaseInOut ); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -302,8 +302,8 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - 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.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::YAXIS ), AlphaFunction::EASE_IN_OUT ); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree(360.0f) ), Vector3::ZAXIS ), AlphaFunction::EASE_IN_OUT ); mActorAnimation.SetEndAction( Animation::Bake ); mActorAnimation.Play(); } @@ -314,7 +314,7 @@ public: { float animDuration = 1.0f; mActorAnimation = Animation::New(animDuration); - mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunctions::Bounce, TimePeriod( 0.0f, 1.0f ) ); + mActorAnimation.AnimateBy( Property( mMotionStretchImageActor, Actor::Property::SCALE ), Vector3(2.0f, 2.0f, 2.0f), AlphaFunction::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 01b9bad..c98a6ef 100644 --- a/examples/radial-menu/radial-menu-example.cpp +++ b/examples/radial-menu/radial-menu-example.cpp @@ -194,8 +194,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.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.AnimateTo( Property( mDialActor, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.8f ) ); + mAnimation.AnimateTo( Property( mRadialSweepView1, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN, TimePeriod( 0.0f, 0.5f ) ); mAnimation.FinishedSignal().Connect( this, &RadialMenuExample::OnAnimationFinished ); mAnimationState = PLAYING; @@ -259,7 +259,7 @@ RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, radialSweepView.SetInitialSector( Degree(0.0f) ); radialSweepView.SetFinalSector( Degree(359.999f) ); radialSweepView.SetSize( Stage::GetCurrent().GetSize()); - radialSweepView.SetEasingFunction( Dali::AlphaFunctions::EaseInOut ); + radialSweepView.SetEasingFunction( Dali::AlphaFunction::EASE_IN_OUT ); radialSweepView.SetPositionInheritanceMode(USE_PARENT_POSITION); mContents.Add(radialSweepView); radialSweepView.Add( mImageActor ); diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index 1062406..44ec95d 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -67,11 +67,13 @@ float HoldZeroFastEaseInOutHoldOne(float progress) } else if(progress < 0.5f) { - return AlphaFunctions::EaseIn((progress-0.2) / 0.3f) * 0.5f; + progress = (progress-0.2) / 0.3f; + return progress*progress*progress*0.5f; } else if(progress < 0.8f) { - return AlphaFunctions::EaseOut((progress - 0.5f) / 0.3f) * 0.5f + 0.5f; + progress = ((progress - 0.5f) / 0.3f) - 1.0f; + return (progress*progress*progress+1.0f) * 0.5f + 0.5f; } else { diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index d459b45..da7a64b 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -353,8 +353,8 @@ private: mScrollViewEffect = ScrollViewDepthEffect::New(); mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); - mScrollView.SetScrollSnapAlphaFunction(AlphaFunctions::EaseOut); - mScrollView.SetScrollFlickAlphaFunction(AlphaFunctions::EaseOut); + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); mScrollView.RemoveConstraintsFromChildren(); break; } @@ -364,8 +364,8 @@ private: mScrollViewEffect = ScrollViewCubeEffect::New(); mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); - mScrollView.SetScrollSnapAlphaFunction(AlphaFunctions::EaseOutBack); - mScrollView.SetScrollFlickAlphaFunction(AlphaFunctions::EaseOutBack); + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT_BACK); + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT_BACK); mScrollView.RemoveConstraintsFromChildren(); break; } @@ -375,8 +375,8 @@ private: mScrollViewEffect = ScrollViewPageCarouselEffect::New(); mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); - mScrollView.SetScrollSnapAlphaFunction(AlphaFunctions::EaseOut); - mScrollView.SetScrollFlickAlphaFunction(AlphaFunctions::EaseOut); + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); mScrollView.RemoveConstraintsFromChildren(); break; } @@ -386,8 +386,8 @@ private: mScrollViewEffect = ScrollViewPageCubeEffect::New(); mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); - mScrollView.SetScrollSnapAlphaFunction(AlphaFunctions::EaseOut); - mScrollView.SetScrollFlickAlphaFunction(AlphaFunctions::EaseOut); + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); mScrollView.RemoveConstraintsFromChildren(); break; } @@ -397,8 +397,8 @@ private: mScrollViewEffect = ScrollViewPageSpiralEffect::New(); mScrollView.SetScrollSnapDuration(EFFECT_SNAP_DURATION); mScrollView.SetScrollFlickDuration(EFFECT_FLICK_DURATION); - mScrollView.SetScrollSnapAlphaFunction(AlphaFunctions::EaseOut); - mScrollView.SetScrollFlickAlphaFunction(AlphaFunctions::EaseOut); + mScrollView.SetScrollSnapAlphaFunction(AlphaFunction::EASE_OUT); + mScrollView.SetScrollFlickAlphaFunction(AlphaFunction::EASE_OUT); mScrollView.RemoveConstraintsFromChildren(); break; } @@ -607,7 +607,7 @@ private: { // Spin the Image a few times. Animation animation = Animation::New(SPIN_DURATION); - animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( Radian( 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 ), AlphaFunction::EASE_OUT ); animation.Play(); } } diff --git a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp index b06a7fd..7e3a22a 100644 --- a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp +++ b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp @@ -277,7 +277,7 @@ public: // Want to animate angle from 30 => -30 and back again smoothly. - mSceneAnimation.AnimateTo( Property( mImageActor2, angleIndex ), Property::Value(-Dali::ANGLE_30), AlphaFunctions::Sin ); + mSceneAnimation.AnimateTo( Property( mImageActor2, angleIndex ), Property::Value(-Dali::ANGLE_30), AlphaFunction::SIN ); mSceneAnimation.SetLooping(true); mSceneAnimation.Play(); diff --git a/examples/text-label-emojis/text-label-emojis.cpp b/examples/text-label-emojis/text-label-emojis.cpp index 8529904..3023974 100644 --- a/examples/text-label-emojis/text-label-emojis.cpp +++ b/examples/text-label-emojis/text-label-emojis.cpp @@ -99,7 +99,7 @@ public: { if( mAnimation ) { - mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); mAnimation.Play(); mLastPoint = localPoint; } diff --git a/examples/text-label-multi-language/text-label-multi-language-example.cpp b/examples/text-label-multi-language/text-label-multi-language-example.cpp index 436b213..78ded00 100644 --- a/examples/text-label-multi-language/text-label-multi-language-example.cpp +++ b/examples/text-label-multi-language/text-label-multi-language-example.cpp @@ -104,7 +104,7 @@ public: { if( mAnimation ) { - mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear ); + mAnimation.AnimateBy( Property(mTableView, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR ); mAnimation.Play(); mLastPoint = localPoint; } -- libgit2 0.21.4