animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
// Play animation after the initial delay time
- DevelAnimation::PlayAfter( animation, 0.2f );
+ animation.PlayAfter( 0.2f );
application.SendNotification();
application.Render(0); // start animation
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
// Play animation after the initial delay time
- DevelAnimation::PlayAfter( animation, 0.2f );
+ animation.PlayAfter( 0.2f );
application.SendNotification();
application.Render(0); // start animation
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR, TimePeriod( 0.5f, 0.5f ) );
// When the delay time is negative value, it would treat as play immediately.
- DevelAnimation::PlayAfter( animation, -2.0f );
+ animation.PlayAfter( -2.0f );
application.SendNotification();
application.Render(0); // start animation
float durationSeconds( 1.0f );
Animation animation = Animation::New( durationSeconds );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::RESTART );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
- DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+ animation.SetLoopingMode( Animation::LoopingMode::AUTO_REVERSE );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
// Start the animation
animation.Play();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
- DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+ animation.SetLoopingMode( Animation::AUTO_REVERSE );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
// Start the animation
animation.Play();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
- DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+ animation.SetLoopingMode( Animation::AUTO_REVERSE );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
// Start the animation
animation.Play();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition );
- DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+ animation.SetLoopingMode( Animation::AUTO_REVERSE );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
// Start the animation
animation.Play();
Animation animation = Animation::New(1.0f);
// default mode
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::RESTART );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::RESTART );
- DevelAnimation::SetLoopingMode( animation, DevelAnimation::LoopingMode::AUTO_REVERSE );
- DALI_TEST_CHECK( DevelAnimation::GetLoopingMode( animation ) == DevelAnimation::AUTO_REVERSE );
+ animation.SetLoopingMode( Animation::AUTO_REVERSE );
+ DALI_TEST_CHECK( animation.GetLoopingMode() == Animation::AUTO_REVERSE );
END_TEST;
}
return GetImplementation( animation ).ProgressReachedSignal();
}
-void PlayAfter( Animation animation, float delaySeconds )
-{
- GetImplementation( animation ).PlayAfter( delaySeconds );
-}
-
-void SetLoopingMode( Animation animation, LoopingMode loopingMode )
-{
- GetImplementation( animation ).SetLoopingMode( loopingMode );
-}
-
-LoopingMode GetLoopingMode( Animation animation )
-{
- return GetImplementation(animation).GetLoopingMode();
-}
-
} // namespace DevelAnimation
} // namespace Dali
{
/**
- * @brief Enumeration for what looping mode is in.
- */
-enum LoopingMode
-{
- RESTART, ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning.
- AUTO_REVERSE ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again.
-};
-
-/**
* @brief Set progress percentage marker to trigger ProgressHasBeenReachedSignal
*
* @param[in] animation the animation object to perform this operation on
*/
DALI_IMPORT_API Animation::AnimationSignalType& ProgressReachedSignal( Animation animation );
-/**
- * @brief Play the animation after a given delay time.
- *
- * The delay time is not included in the looping time.
- * When the delay time is negative value, it would treat as play immediately.
- * @param[in] animation The animation object to perform this operation on
- * @param[in] delaySeconds The delay time
- */
-DALI_IMPORT_API void PlayAfter( Animation animation, float delaySeconds );
-
-/**
- * @brief Sets the looping mode.
- *
- * Animation plays forwards and then restarts from the beginning or runs backwards again.
- * @param[in] animation The animation object to perform this operation on
- * @param[in] loopingMode The looping mode is one of RESTART and AUTO_REVERSE
- */
-DALI_IMPORT_API void SetLoopingMode( Animation animation, LoopingMode loopingMode );
-
-/**
- * @brief Gets one of the current looping mode.
- *
- * @param[in] animation The animation object to perform this operation on
- * @return The current looping mode
- */
-DALI_IMPORT_API LoopingMode GetLoopingMode( Animation animation );
-
} // namespace DevelAnimation
} // namespace Dali
return mPlayRange;
}
-void Animation::SetLoopingMode( DevelAnimation::LoopingMode loopingMode )
+void Animation::SetLoopingMode( Dali::Animation::LoopingMode loopingMode )
{
- mAutoReverseEnabled = ( loopingMode == DevelAnimation::LoopingMode::AUTO_REVERSE );
+ mAutoReverseEnabled = ( loopingMode == Dali::Animation::LoopingMode::AUTO_REVERSE );
// mAnimation is being used in a separate thread; queue a message to set play range
SetLoopingModeMessage( mEventThreadServices, *mAnimation, mAutoReverseEnabled );
}
-DevelAnimation::LoopingMode Animation::GetLoopingMode()
+Dali::Animation::LoopingMode Animation::GetLoopingMode() const
{
- return mAutoReverseEnabled ? DevelAnimation::LoopingMode::AUTO_REVERSE : DevelAnimation::LoopingMode::RESTART;
+ return mAutoReverseEnabled ? Dali::Animation::AUTO_REVERSE : Dali::Animation::RESTART;
}
bool Animation::CompareConnectorEndTimes( const Animation::ConnectorTargetValues& lhs, const Animation::ConnectorTargetValues& rhs )
/**
* @copydoc Dali::Animation::SetLoopingMode()
*/
- void SetLoopingMode( Dali::DevelAnimation::LoopingMode loopingMode );
+ void SetLoopingMode( Dali::Animation::LoopingMode loopingMode );
/**
* @copydoc Dali::Animation::GetLoopingMode()
*/
- Dali::DevelAnimation::LoopingMode GetLoopingMode();
+ Dali::Animation::LoopingMode GetLoopingMode() const;
public: // For connecting animators to animations
GetImplementation(*this).PlayFrom(progress);
}
+void Animation::PlayAfter( float delaySeconds )
+{
+ GetImplementation( *this ).PlayAfter( delaySeconds );
+}
void Animation::Pause()
{
GetImplementation(*this).Clear();
}
+void Animation::SetLoopingMode( LoopingMode loopingMode )
+{
+ GetImplementation( *this ).SetLoopingMode( loopingMode );
+}
+
+Animation::LoopingMode Animation::GetLoopingMode() const
+{
+ return GetImplementation( *this ).GetLoopingMode();
+}
+
Animation::AnimationSignalType& Animation::FinishedSignal()
{
return GetImplementation(*this).FinishedSignal();
-#ifndef __DALI_ANIMATION_H__
-#define __DALI_ANIMATION_H__
+#ifndef DALI_ANIMATION_H
+#define DALI_ANIMATION_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
};
/**
+ * @brief Enumeration for what looping mode is in.
+ *
+ * @SINCE_1_2.60
+ */
+ enum LoopingMode
+ {
+ RESTART, ///< When the animation arrives at the end in looping mode, the animation restarts from the beginning. @SINCE_1_2.60
+ AUTO_REVERSE ///< When the animation arrives at the end in looping mode, the animation reverses direction and runs backwards again. @SINCE_1_2.60
+ };
+
+ /**
* @brief Creates an uninitialized Animation; this can be initialized with Animation::New().
*
* Calling member functions with an uninitialized Animation handle is not allowed.
void PlayFrom( float progress );
/**
+ * @brief Play the animation after a given delay time.
+ *
+ * The delay time is not included in the looping time.
+ * When the delay time is negative value, it would treat as play immediately.
+ * @SINCE_1_2.60
+ * @param[in] delaySeconds The delay time
+ */
+ void PlayAfter( float delaySeconds );
+
+ /**
* @brief Pauses the animation.
* @SINCE_1_0.0
*/
void Clear();
/**
+ * @brief Sets the looping mode.
+ *
+ * Animation plays forwards and then restarts from the beginning or runs backwards again.
+ * @SINCE_1_2.60
+ * @param[in] loopingMode The looping mode is one of RESTART and AUTO_REVERSE
+ */
+ void SetLoopingMode( LoopingMode loopingMode );
+
+ /**
+ * @brief Gets one of the current looping mode.
+ *
+ * @SINCE_1_2.60
+ * @return The current looping mode
+ */
+ LoopingMode GetLoopingMode() const;
+
+ /**
* @brief Connects to this signal to be notified when an Animation's animations have finished.
*
* @SINCE_1_0.0
*/
} // namespace Dali
-#endif // __DALI_ANIMATION_H__
+#endif // DALI_ANIMATION_H