{
ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+ ExtendDuration( period );
+
switch ( relativeValue.GetType() )
{
case Property::BOOLEAN:
}
DALI_ASSERT_ALWAYS( type == destinationValue.GetType() && "DestinationValue does not match Target Property type" );
+ ExtendDuration( period );
+
switch (destinationValue.GetType())
{
case Property::BOOLEAN:
{
ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+ ExtendDuration( period );
+
switch(keyFrames.GetType())
{
case Dali::Property::BOOLEAN:
ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+ ExtendDuration( period );
+
switch ( targetType )
{
case Property::BOOLEAN:
void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
Dali::Actor::POSITION,
Property::INVALID_COMPONENT_INDEX,
void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
Dali::Actor::POSITION,
Property::INVALID_COMPONENT_INDEX,
void Animation::Move(Actor& actor, AnimatorFunctionVector3 func, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
Dali::Actor::POSITION,
Property::INVALID_COMPONENT_INDEX,
void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
Dali::Actor::ROTATION,
Property::INVALID_COMPONENT_INDEX,
void Animation::RotateTo(Actor& actor, const Quaternion& rotation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
Dali::Actor::ROTATION,
Property::INVALID_COMPONENT_INDEX,
void Animation::Rotate(Actor& actor, AnimatorFunctionQuaternion func, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
Dali::Actor::ROTATION,
Property::INVALID_COMPONENT_INDEX,
void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
Dali::Actor::SCALE,
Property::INVALID_COMPONENT_INDEX,
void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
Dali::Actor::SCALE,
Property::INVALID_COMPONENT_INDEX,
void Animation::Show(Actor& actor, float delaySeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, 0) );
+
AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
Dali::Actor::VISIBLE,
Property::INVALID_COMPONENT_INDEX,
void Animation::Hide(Actor& actor, float delaySeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, 0) );
+
AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
Dali::Actor::VISIBLE,
Property::INVALID_COMPONENT_INDEX,
void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
Dali::Actor::COLOR,
Property::INVALID_COMPONENT_INDEX,
void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
Dali::Actor::COLOR,
Property::INVALID_COMPONENT_INDEX,
void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
Dali::Actor::COLOR,
Property::INVALID_COMPONENT_INDEX,
void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
Dali::Actor::COLOR,
Property::INVALID_COMPONENT_INDEX,
{
Vector3 targetSize( width, height, min(width, height) );
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
// notify the actor impl that its size is being animated
actor.OnSizeAnimation( *this, targetSize );
void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
{
+ ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+
// notify the actor impl that its size is being animated
actor.OnSizeAnimation( *this, size );
TimePeriod(delaySeconds, durationSeconds) ) );
}
-void Animation::ParentOriginTo(Actor& actor, const Vector3& parentOrigin)
-{
- ParentOriginTo(actor, parentOrigin, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ParentOriginTo(Actor& actor, const Vector3& parentOrigin, AlphaFunction alpha)
-{
- ParentOriginTo(actor, parentOrigin, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ParentOriginTo(Actor& actor, const Vector3& parentOrigin, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::PARENT_ORIGIN,
- Property::INVALID_COMPONENT_INDEX,
- AnimateToVector3(parentOrigin),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::AnchorPointTo(Actor& actor, const Vector3& anchorPoint)
-{
- AnchorPointTo(actor, anchorPoint, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::AnchorPointTo(Actor& actor, const Vector3& anchorPoint, AlphaFunction alpha)
-{
- AnchorPointTo(actor, anchorPoint, alpha, 0.0f, GetDuration());
-}
-
-void Animation::AnchorPointTo(Actor& actor, const Vector3& anchorPoint, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::ANCHOR_POINT,
- Property::INVALID_COMPONENT_INDEX,
- AnimateToVector3(anchorPoint),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, float value )
-{
- AnimateProperty( shaderEffect, name, value, GetDefaultAlphaFunction(), 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha )
-{
- AnimateProperty( shaderEffect, name, value, alpha, 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha, float delaySeconds, float durationSeconds )
-{
- Property::Value propertyValue( value );
-
- // Register the property if it does not exist
- Property::Index index = shaderEffect.GetPropertyIndex( name );
- if ( Property::INVALID_INDEX == index )
- {
- index = shaderEffect.RegisterProperty( name, propertyValue );
- }
-
- AnimateTo( shaderEffect, index, Property::INVALID_COMPONENT_INDEX, propertyValue, alpha, TimePeriod(delaySeconds, durationSeconds) );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector2 value )
-{
- AnimateProperty( shaderEffect, name, value, GetDefaultAlphaFunction(), 0, GetDuration());
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha )
-{
- AnimateProperty( shaderEffect, name, value, alpha, 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha, float delaySeconds, float durationSeconds )
-{
- Property::Value propertyValue( value );
-
- // Register the property if it does not exist
- Property::Index index = shaderEffect.GetPropertyIndex( name );
- if ( Property::INVALID_INDEX == index )
- {
- index = shaderEffect.RegisterProperty( name, propertyValue );
- }
-
- AnimateTo( shaderEffect, index, Property::INVALID_COMPONENT_INDEX, propertyValue, alpha, TimePeriod(delaySeconds, durationSeconds) );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector3 value )
-{
- AnimateProperty( shaderEffect, name, value, GetDefaultAlphaFunction(), 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha )
-{
- AnimateProperty( shaderEffect, name, value, alpha, 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha, float delaySeconds, float durationSeconds )
-{
- Property::Value propertyValue( value );
-
- // Register the property if it does not exist
- Property::Index index = shaderEffect.GetPropertyIndex( name );
- if ( Property::INVALID_INDEX == index )
- {
- index = shaderEffect.RegisterProperty( name, propertyValue );
- }
-
- AnimateTo( shaderEffect, index, Property::INVALID_COMPONENT_INDEX, propertyValue, alpha, TimePeriod(delaySeconds, durationSeconds) );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector4 value )
-{
- AnimateProperty( shaderEffect, name, value, GetDefaultAlphaFunction(), 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha )
-{
- AnimateProperty( shaderEffect, name, value, alpha, 0, GetDuration() );
-}
-
-void Animation::AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha, float delaySeconds, float durationSeconds )
-{
- Property::Value propertyValue( value );
-
- // Register the property if it does not exist
- Property::Index index = shaderEffect.GetPropertyIndex( name );
- if ( Property::INVALID_INDEX == index )
- {
- index = shaderEffect.RegisterProperty( name, propertyValue );
- }
-
- AnimateTo( shaderEffect, index, Property::INVALID_COMPONENT_INDEX, propertyValue, alpha, TimePeriod(delaySeconds, durationSeconds) );
-}
-
bool Animation::DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
{
bool done = false;
}
}
+void Animation::ExtendDuration( const TimePeriod& timePeriod )
+{
+ float duration = timePeriod.delaySeconds + timePeriod.durationSeconds;
+
+ if( duration > mDurationSeconds )
+ {
+ SetDuration( duration );
+ }
+}
+
} // namespace Internal
} // namespace Dali
*/
void Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
- /**
- * Animate the parent-origin of an actor.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] parentOrigin The target value.
- */
- void ParentOriginTo(Actor& actor, const Vector3& parentOrigin);
-
- /**
- * Animate the parent-origin of an actor.
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] parentOrigin The target value.
- * @param [in] alpha The alpha function to apply.
- */
- void ParentOriginTo(Actor& actor, const Vector3& parentOrigin, AlphaFunction alpha);
-
- /**
- * Animate the parent-origin of an actor.
- * This overload allows the start & end time to be customized.
- * @pre delaySeconds & durationSeconds must be zero or greater.
- * @param [in] actor The actor to animate.
- * @param [in] parentOrigin The target value.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the effect.
- * @param [in] durationSeconds The duration of the effect.
- */
- void ParentOriginTo(Actor& actor, const Vector3& parentOrigin, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * Animate the anchor-point of an actor.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] anchorPoint The target value.
- */
- void AnchorPointTo(Actor& actor, const Vector3& anchorPoint);
-
- /**
- * Animate the anchor-point of an actor.
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] anchorPoint The target value.
- * @param [in] alpha The alpha function to apply.
- */
- void AnchorPointTo(Actor& actor, const Vector3& anchorPoint, AlphaFunction alpha);
-
- /**
- * Animate the anchor-point of an actor.
- * This overload allows the start & end time to be customized.
- * @pre delaySeconds & durationSeconds must be zero or greater.
- * @param [in] actor The actor to animate.
- * @param [in] anchorPoint The target value.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the effect.
- * @param [in] durationSeconds The duration of the effect.
- */
- void AnchorPointTo(Actor& actor, const Vector3& anchorPoint, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, float value)
- */
- void AnimateProperty( Internal::ShaderEffect& shaderEffect, const std::string& name, float value );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha)
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, float value, AlphaFunction alpha, float delaySeconds, float durationSeconds );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector2 value, AlphaFunction alpha, float delaySeconds, float durationSeconds );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha, float delaySeconds, float durationSeconds )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector3 value, AlphaFunction alpha, float delaySeconds, float durationSeconds );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value )
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha)
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha );
-
- /**
- * @copydoc Dali::Animation::AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void AnimateProperty( ShaderEffect& shaderEffect, const std::string& name, Vector4 value, AlphaFunction alpha, float delaySeconds, float durationSeconds );
-
/*
* @copydoc Dali::Animation::GetCurrentProgress()
*/
private:
+ /**
+ * Extends the duration when an animator is added with TimePeriod that exceeds current duration.
+ * @param[in] timePeriod The time period for an animator.
+ */
+ void ExtendDuration( const TimePeriod& timePeriod );
+
// Undefined
Animation(const Animation&);