1 #ifndef __DALI_ANIMATION_H__
2 #define __DALI_ANIMATION_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/animation/alpha-functions.h>
23 #include <dali/public-api/animation/key-frames.h>
24 #include <dali/public-api/animation/path.h>
25 #include <dali/public-api/animation/time-period.h>
26 #include <dali/public-api/object/any.h>
27 #include <dali/public-api/object/handle.h>
28 #include <dali/public-api/object/property.h>
29 #include <dali/public-api/signals/dali-signal.h>
44 namespace Internal DALI_INTERNAL
50 * @brief Dali::Animation can be used to animate the properties of any number of objects, typically Actors.
52 * An example animation setup is shown below:
58 * Actor mActor; // The object we wish to animate
59 * Animation mAnimation; // Keep this to control the animation
62 * // ...To play the animation
64 * mAnimation = Animation::New(3.0f); // duration 3 seconds
65 * mAnimation.MoveTo(mActor, 10.0f, 50.0f, 0.0f);
70 * Dali::Animation supports "fire and forget" behaviour i.e. an animation continues to play if the handle is discarded.
71 * Note that in the following example, the "Finish" signal will be emitted:
75 * void ExampleCallback( Animation& source )
77 * std::cout << "Animation has finished" << std::endl;
80 * void ExampleAnimation( Actor actor )
82 * Animation animation = Animation::New(2.0f); // duration 2 seconds
83 * animation.MoveTo(actor, 10.0f, 50.0f, 0.0f);
84 * animation.FinishedSignal().Connect( ExampleCallback );
86 * } // At this point the animation handle has gone out of scope
88 * Actor actor = Actor::New();
89 * Stage::GetCurrent().Add( actor );
91 * // Fire animation and forget about it
92 * ExampleAnimation( actor );
94 * // However the animation will continue, and "Animation has finished" will be printed after 2 seconds.
98 * If the "Finish" signal is connected to a member function of an object, it must be disconnected before the object is destroyed.
99 * This is typically done in the object destructor, and requires either the Dali::Connection object or Dali::Animation handle to be stored.
101 class DALI_IMPORT_API Animation : public BaseHandle
105 typedef Signal< void (Animation&) > AnimationSignalType; ///< Animation finished signal type
107 typedef Any AnyFunction; ///< Interpolation function
110 * @brief What to do when the animation ends, is stopped or is destroyed
114 Bake, ///< When the animation ends, the animated property values are saved.
115 Discard, ///< When the animation ends, the animated property values are forgotten.
116 BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake.
120 * @brief What interpolation method to use on key-frame animations
124 Linear, ///< Values in between key frames are interpolated using a linear polynomial. (Default)
125 Cubic ///< Values in between key frames are interpolated using a cubic polynomial.
129 static const char* const SIGNAL_FINISHED; ///< name "finished"
132 static const char* const ACTION_PLAY; ///< name "play"
133 static const char* const ACTION_STOP; ///< name "stop"
134 static const char* const ACTION_PAUSE; ///< name "pause"
137 * @brief Create an uninitialized Animation; this can be initialized with Animation::New().
139 * Calling member functions with an uninitialized Dali::Object is not allowed.
144 * @brief Create an initialized Animation.
146 * The animation will not loop.
147 * The default end action is "Bake".
148 * The default alpha function is linear.
149 * @pre durationSeconds must be greater than zero.
150 * @param [in] durationSeconds The duration in seconds.
151 * @return A handle to a newly allocated Dali resource.
153 static Animation New(float durationSeconds);
156 * @brief Downcast an Object handle to Animation.
158 * If handle points to an Animation object the downcast produces
159 * valid handle. If not the returned handle is left uninitialized.
161 * @param[in] handle to An object
162 * @return handle to a Animation object or an uninitialized handle
164 static Animation DownCast( BaseHandle handle );
169 * This is non-virtual since derived Handle types must not contain data or virtual methods.
174 * @brief This copy constructor is required for (smart) pointer semantics.
176 * @param [in] handle A reference to the copied handle
178 Animation(const Animation& handle);
181 * @brief This assignment operator is required for (smart) pointer semantics.
183 * @param [in] rhs A reference to the copied handle
184 * @return A reference to this
186 Animation& operator=(const Animation& rhs);
189 * @brief Set the duration of an animation.
191 * @pre durationSeconds must be greater than zero.
192 * @param[in] seconds The duration in seconds.
194 void SetDuration(float seconds);
197 * @brief Retrieve the duration of an animation.
199 * @return The duration in seconds.
201 float GetDuration() const;
204 * @brief Set whether the animation will loop.
206 * @param[in] looping True if the animation will loop.
208 void SetLooping(bool looping);
211 * @brief Query whether the animation will loop.
213 * @return True if the animation will loop.
215 bool IsLooping() const;
218 * @brief Set the end action of the animation.
220 * This action is performed when the animation ends or if it is stopped.
221 * Default end action is bake
222 * @param[in] action The end action.
224 void SetEndAction(EndAction action);
227 * @brief Returns the end action of the animation.
229 * @return The end action.
231 EndAction GetEndAction() const;
234 * @brief Set the disconnect action.
236 * If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
237 * Default action is to BakeFinal.
238 * @param[in] disconnectAction The disconnect action.
240 void SetDisconnectAction( EndAction disconnectAction );
243 * @brief Returns the disconnect action.
245 * @return The disconnect action.
247 EndAction GetDisconnectAction() const;
250 * @brief Set the default alpha function for an animation.
252 * This is applied to individual property animations, if no further alpha functions are supplied.
253 * @param[in] alpha The default alpha function.
255 void SetDefaultAlphaFunction(AlphaFunction alpha);
258 * @brief Retrieve the default alpha function for an animation.
260 * @return The default alpha function.
262 AlphaFunction GetDefaultAlphaFunction() const;
265 * @brief Sets the progress of the animation.
266 * The animation will play (or continue playing) from this point. The progress
267 * must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
268 * otherwise, it will be ignored.
270 * @param[in] progress The new progress as a normalized value between [0,1] or between the
271 * play range if specified.
273 void SetCurrentProgress( float progress );
276 * @brief Retrieve the current progress of the animation.
278 * @return The current progress as a normalized value between [0,1].
280 float GetCurrentProgress();
283 * @brief Specifies an speed factor for the animation.
285 * The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will
286 * slow down the animation and values above one will speed up the animation. It is also possible to specify a negative multiplier
287 * to play the animation in reverse.
289 * @param[in] factor A value which will multiply the velocity.
291 void SetSpeedFactor( float factor );
294 * @brief Retrieve the speed factor of the animation
296 * @return speed factor
298 float GetSpeedFactor() const;
301 * @brief Set the playing range.
302 * Animation will play between the values specified. Both values ( range.x and range.y ) should be between 0-1,
303 * otherwise they will be ignored. If the range provided is not in proper order ( minimum,maximum ), it will be reordered.
305 * @param[in] range Two values between [0,1] to specify minimum and maximum progress. The
306 * animation will play between those values.
308 void SetPlayRange( const Vector2& range );
311 * @brief Get the playing range
313 * @return The play range defined for the animation.
315 Vector2 GetPlayRange() const;
318 * @brief Play the animation.
323 * @brief Play the animation from a given point.
324 * The progress must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
325 * otherwise, it will be ignored.
327 * @param[in] progress A value between [0,1], or between the play range if specified, form where the animation should start playing
329 void PlayFrom( float progress );
332 * @brief Pause the animation.
337 * @brief Stop the animation.
342 * @brief Clear the animation.
344 * This disconnects any objects that were being animated, effectively stopping the animation.
349 * @brief Connect to this signal to be notified when an Animation's animations have finished.
351 * @return A signal object to Connect() with.
353 AnimationSignalType& FinishedSignal();
356 * @brief Animate a property value by a relative amount.
358 * The default alpha function will be used.
359 * The effect will start & end when the animation begins & ends.
360 * @param [in] target The target object/property to animate.
361 * @param [in] relativeValue The property value will change by this amount.
363 void AnimateBy(Property target, Property::Value relativeValue);
366 * @brief Animate a property value by a relative amount.
368 * The effect will start & end when the animation begins & ends.
369 * @param [in] target The target object/property to animate.
370 * @param [in] relativeValue The property value will change by this amount.
371 * @param [in] alpha The alpha function to apply.
373 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha);
376 * @brief Animate a property value by a relative amount.
378 * The default alpha function will be used.
379 * @param [in] target The target object/property to animate.
380 * @param [in] relativeValue The property value will increase/decrease by this amount.
381 * @param [in] period The effect will occur during this time period.
383 void AnimateBy(Property target, Property::Value relativeValue, TimePeriod period);
386 * @brief Animate a property value by a relative amount.
388 * @param [in] target The target object/property to animate.
389 * @param [in] relativeValue The property value will increase/decrease by this amount.
390 * @param [in] alpha The alpha function to apply.
391 * @param [in] period The effect will occur during this time period.
393 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period);
396 * @brief Animate a property to a destination value.
398 * The default alpha function will be used.
399 * The effect will start & end when the animation begins & ends.
400 * @param [in] target The target object/property to animate.
401 * @param [in] destinationValue The destination value.
403 void AnimateTo(Property target, Property::Value destinationValue);
406 * @brief Animate a property to a destination value.
408 * The effect will start & end when the animation begins & ends.
409 * @param [in] target The target object/property to animate.
410 * @param [in] destinationValue The destination value.
411 * @param [in] alpha The alpha function to apply.
413 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha);
416 * @brief Animate a property to a destination value.
418 * The default alpha function will be used.
419 * @param [in] target The target object/property to animate.
420 * @param [in] destinationValue The destination value.
421 * @param [in] period The effect will occur during this time period.
423 void AnimateTo(Property target, Property::Value destinationValue, TimePeriod period);
426 * @brief Animate a property to a destination value.
428 * @param [in] target The target object/property to animate.
429 * @param [in] destinationValue The destination value.
430 * @param [in] alpha The alpha function to apply.
431 * @param [in] period The effect will occur during this time period.
433 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
436 * @brief Animate a property between keyframes.
438 * @param [in] target The target object/property to animate.
439 * @param [in] keyFrames The key frames
441 void AnimateBetween(Property target, KeyFrames& keyFrames);
444 * @brief Animate a property between keyframes.
446 * @param [in] target The target object + property to animate
447 * @param [in] keyFrames The set of time / value pairs between which to animate.
448 * @param [in] interpolation The method used to interpolate between values.
450 void AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation);
453 * @brief Animate a property between keyframes.
455 * @param [in] target The target object/property to animate.
456 * @param [in] keyFrames The key frames
457 * @param [in] alpha The alpha function to apply.
459 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha);
462 * @brief Animate a property between keyframes.
464 * @param [in] target The target object + property to animate
465 * @param [in] keyFrames The set of time / value pairs between which to animate.
466 * @param [in] alpha The alpha function to apply.
467 * @param [in] interpolation The method used to interpolate between values.
469 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation);
472 * @brief Animate a property between keyframes.
474 * @param [in] target The target object/property to animate.
475 * @param [in] keyFrames The key frames
476 * @param [in] period The effect will occur during this time period.
478 void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period);
481 * @brief Animate a property between keyframes.
483 * @param [in] target The target object + property to animate
484 * @param [in] keyFrames The set of time / value pairs between which to animate.
485 * @param [in] period The effect will occur duing this time period.
486 * @param [in] interpolation The method used to interpolate between values.
488 void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
491 * @brief Animate a property between keyframes.
493 * @param [in] target The target object/property to animate.
494 * @param [in] keyFrames The key frames
495 * @param [in] alpha The alpha function to apply.
496 * @param [in] period The effect will occur during this time period.
498 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
501 * @brief Animate a property between keyframes.
503 * @param [in] target The target object + property to animate
504 * @param [in] keyFrames The set of time / value pairs between which to animate.
505 * @param [in] alpha The alpha function to apply to the overall progress.
506 * @param [in] period The effect will occur duing this time period.
507 * @param [in] interpolation The method used to interpolate between values.
509 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
512 // Actor-specific convenience methods
515 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
516 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
518 * @param[in] actor The actor to animate
519 * @param[in] path The path. It defines position and orientation
520 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
522 void Animate( Actor actor, Path path, const Vector3& forward );
525 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
526 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
528 * @param[in] actor The actor to animate
529 * @param[in] path The path. It defines position and orientation
530 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
531 * @param [in] alpha The alpha function to apply.
533 void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha );
536 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
537 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
539 * @param[in] actor The actor to animate
540 * @param[in] path The path. It defines position and orientation
541 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
542 * @param [in] period The effect will occur during this time period.
544 void Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period );
547 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
548 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
550 * @param[in] actor The actor to animate
551 * @param[in] path The path. It defines position and orientation
552 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
553 * @param [in] alpha The alpha function to apply.
554 * @param [in] period The effect will occur during this time period.
556 void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period);
559 * @brief Move an actor relative to its position.
561 * The default alpha function will be used.
562 * The move will start & end when the animation begins & ends.
563 * @param [in] actor The actor to animate.
564 * @param [in] x axis displacement.
565 * @param [in] y axis displacement.
566 * @param [in] z axis displacement.
568 void MoveBy(Actor actor, float x, float y, float z);
571 * @brief Move an actor relative to its position.
573 * This overload allows the alpha function to be customized.
574 * The move will start & end when the animation begins & ends.
575 * @param [in] actor The actor to animate.
576 * @param [in] displacement relative to current position.
577 * @param [in] alpha The alpha function to apply.
579 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha);
582 * @brief Move an actor relative to its position.
584 * This overload allows the translation start & end time to be customized.
585 * @pre delaySeconds must be zero or greater.
586 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
587 * @param [in] actor The actor to animate.
588 * @param [in] displacement relative to current position.
589 * @param [in] alpha The alpha function to apply.
590 * @param [in] delaySeconds The initial delay from the start of the animation.
591 * @param [in] durationSeconds The duration of the translation.
593 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds);
596 * @brief Move an actor to a target position.
598 * The default alpha function will be used.
599 * The move will start & end when the animation begins & ends.
600 * @param [in] actor The actor to animate.
601 * @param [in] x axis position.
602 * @param [in] y axis position.
603 * @param [in] z axis position.
605 void MoveTo(Actor actor, float x, float y, float z);
608 * @brief Move an actor to a target position.
610 * This overload allows the alpha function to be customized.
611 * The move will start & end when the animation begins & ends.
612 * @param [in] actor The actor to animate.
613 * @param [in] position to move to
614 * @param [in] alpha The alpha function to apply.
616 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha);
619 * @brief Move an actor to a target position.
621 * This overload allows the translation start & end time to be customized.
622 * @pre delaySeconds must be zero or greater.
623 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
624 * @param [in] actor The actor to animate.
625 * @param [in] position to move to
626 * @param [in] alpha The alpha function to apply.
627 * @param [in] delaySeconds The initial delay from the start of the animation.
628 * @param [in] durationSeconds The duration of the translation.
630 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds);
633 * @brief Rotate an actor around an arbitrary axis.
635 * The default alpha function will be used.
636 * The rotation will start & end when the animation begins & ends.
637 * @param [in] actor The actor to animate.
638 * @param [in] angle The angle in degrees.
639 * @param [in] axis The axis to rotate around
641 void RotateBy(Actor actor, Degree angle, Vector3 axis);
644 * @brief Rotate an actor around an arbitrary axis.
646 * The default alpha function will be used.
647 * The rotation will start & end when the animation begins & ends.
648 * @param [in] actor The actor to animate.
649 * @param [in] angle The angle in radians.
650 * @param [in] axis The axis to rotate around
652 void RotateBy(Actor actor, Radian angle, Vector3 axis);
655 * @brief Rotate an actor around an arbitrary axis.
657 * This overload allows the alpha function to be customized.
658 * The rotation will start & end when the animation begins & ends.
659 * @param [in] actor The actor to animate.
660 * @param [in] angle The angle in radians.
661 * @param [in] axis The axis to rotate around.
662 * @param [in] alpha The alpha function to apply.
664 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
667 * @brief Rotate an actor around an arbitrary axis.
669 * This overload allows the alpha function to be customized.
670 * The rotation will start & end when the animation begins & ends.
671 * @param [in] actor The actor to animate.
672 * @param [in] angle The angle in radians.
673 * @param [in] axis The axis to rotate around.
674 * @param [in] alpha The alpha function to apply.
676 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
679 * @brief Rotate an actor around an arbitrary axis.
681 * This overload allows the rotation start & end time to be customized.
682 * @pre delaySeconds must be zero or greater.
683 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
684 * @param [in] actor The actor to animate.
685 * @param [in] angle The angle in degrees.
686 * @param [in] axis The axis to rotate around
687 * @param [in] alpha The alpha function to apply.
688 * @param [in] delaySeconds The initial delay from the start of the animation.
689 * @param [in] durationSeconds The duration of the rotation.
691 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
694 * @brief Rotate an actor around an arbitrary axis.
696 * This overload allows the rotation start & end time to be customized.
697 * @pre delaySeconds must be zero or greater.
698 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
699 * @param [in] actor The actor to animate.
700 * @param [in] angle The angle in radians.
701 * @param [in] axis The axis to rotate around
702 * @param [in] alpha The alpha function to apply.
703 * @param [in] delaySeconds The initial delay from the start of the animation.
704 * @param [in] durationSeconds The duration of the rotation.
706 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
709 * @brief Rotate an actor to a target orientation.
711 * The default alpha function will be used.
712 * The rotation will start & end when the animation begins & ends.
713 * @param [in] actor The actor to animate.
714 * @param [in] angle The target rotation angle in degrees.
715 * @param [in] axis The target axis of rotation.
717 void RotateTo(Actor actor, Degree angle, Vector3 axis);
720 * @brief Rotate an actor to a target orientation.
722 * The default alpha function will be used.
723 * The rotation will start & end when the animation begins & ends.
724 * @param [in] actor The actor to animate.
725 * @param [in] angle The target rotation angle in radians.
726 * @param [in] axis The target axis of rotation.
728 void RotateTo(Actor actor, Radian angle, Vector3 axis);
731 * @brief Rotate an actor to a target orientation.
733 * The default alpha function will be used.
734 * The rotation will start & end when the animation begins & ends.
735 * @param [in] actor The actor to animate.
736 * @param [in] orientation The target orientation.
738 void RotateTo(Actor actor, Quaternion orientation);
741 * @brief Rotate an actor to a target orientation.
743 * This overload allows the alpha function to be customized.
744 * The rotation will start & end when the animation begins & ends.
745 * @param [in] actor The actor to animate.
746 * @param [in] angle The target rotation angle in degrees.
747 * @param [in] axis The target axis of rotation.
748 * @param [in] alpha The alpha function to apply.
750 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
753 * @brief Rotate an actor to a target orientation.
755 * This overload allows the alpha function to be customized.
756 * The rotation will start & end when the animation begins & ends.
757 * @param [in] actor The actor to animate.
758 * @param [in] angle The target rotation angle in radians.
759 * @param [in] axis The target axis of rotation.
760 * @param [in] alpha The alpha function to apply.
762 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
765 * @brief Rotate an actor to a target orientation.
767 * This overload allows the alpha function to be customized.
768 * The rotation will start & end when the animation begins & ends.
769 * @param [in] actor The actor to animate.
770 * @param [in] orientation The target orientation.
771 * @param [in] alpha The alpha function to apply.
773 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha);
776 * @brief Rotate an actor to a target orientation.
778 * This overload allows the rotation start & end time to be customized.
779 * @pre delaySeconds must be zero or greater.
780 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
781 * @param [in] actor The actor to animate.
782 * @param [in] angle The target rotation angle in degrees.
783 * @param [in] axis The target axis of rotation.
784 * @param [in] alpha The alpha function to apply.
785 * @param [in] delaySeconds The initial delay from the start of the animation.
786 * @param [in] durationSeconds The duration of the rotation.
788 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
791 * @brief Rotate an actor to a target orientation.
793 * This overload allows the rotation start & end time to be customized.
794 * @pre delaySeconds must be zero or greater.
795 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
796 * @param [in] actor The actor to animate.
797 * @param [in] angle The target rotation angle in radians.
798 * @param [in] axis The target axis of rotation.
799 * @param [in] alpha The alpha function to apply.
800 * @param [in] delaySeconds The initial delay from the start of the animation.
801 * @param [in] durationSeconds The duration of the rotation.
803 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
806 * @brief Rotate an actor to a target orientation.
808 * This overload allows the rotation start & end time to be customized.
809 * @pre delaySeconds must be zero or greater.
810 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
811 * @param [in] actor The actor to animate.
812 * @param [in] orientation The target orientation.
813 * @param [in] alpha The alpha function to apply.
814 * @param [in] delaySeconds The initial delay from the start of the animation.
815 * @param [in] durationSeconds The duration of the rotation.
817 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
820 * @brief Scale an actor.
822 * The default alpha function will be used.
823 * The scaling will start & end when the animation begins & ends.
824 * @param [in] actor The actor to animate.
825 * @param [in] x Scale factor in the X-direction.
826 * @param [in] y Scale factor in the Y-direction.
827 * @param [in] z Scale factor in the Z-direction.
829 void ScaleBy(Actor actor, float x, float y, float z);
832 * @brief Scale an actor.
834 * This overload allows the alpha function to be customized.
835 * The scaling will start & end when the animation begins & ends.
836 * @param [in] actor The actor to animate.
837 * @param [in] scale The scale factor.
838 * @param [in] alpha The alpha function to apply.
840 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha);
843 * @brief Scale an actor.
845 * This overload allows the scaling start & end time to be customized.
846 * @pre delaySeconds must be zero or greater.
847 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
848 * @param [in] actor The actor to animate.
849 * @param [in] scale The scale factor.
850 * @param [in] alpha The alpha function to apply.
851 * @param [in] delaySeconds The initial delay from the start of the animation.
852 * @param [in] durationSeconds The duration of the scaling.
854 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
857 * @brief Scale an actor to a target scale factor.
859 * The default alpha function will be used.
860 * The scaling will start & end when the animation begins & ends.
861 * @param [in] actor The actor to animate.
862 * @param [in] x Target scale-factor in the X-direction.
863 * @param [in] y Target scale-factor in the Y-direction.
864 * @param [in] z Target scale-factor in the Z-direction.
866 void ScaleTo(Actor actor, float x, float y, float z);
869 * @brief Scale an actor to a target scale factor.
871 * This overload allows the alpha function to be customized.
872 * The scaling will start & end when the animation begins & ends.
873 * @param [in] actor The actor to animate.
874 * @param [in] scale The target scale factor.
875 * @param [in] alpha The alpha function to apply.
877 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha);
880 * @brief Scale an actor to a target scale factor.
882 * This overload allows the scaling start & end time to be customized.
883 * @pre delaySeconds must be zero or greater.
884 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
885 * @param [in] actor The actor to animate.
886 * @param [in] scale The target scale factor.
887 * @param [in] alpha The alpha function to apply.
888 * @param [in] delaySeconds The initial delay from the start of the animation.
889 * @param [in] durationSeconds The duration of the scaling.
891 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
894 * @brief Show an actor during the animation.
896 * @param [in] actor The actor to animate.
897 * @param [in] delaySeconds The initial delay from the start of the animation.
899 void Show(Actor actor, float delaySeconds);
902 * @brief Hide an actor during the animation.
904 * @param [in] actor The actor to animate.
905 * @param [in] delaySeconds The initial delay from the start of the animation.
907 void Hide(Actor actor, float delaySeconds);
910 * @brief Animate the opacity of an actor.
912 * The default alpha function will be used.
913 * The effect will start & end when the animation begins & ends.
914 * @param [in] actor The actor to animate.
915 * @param [in] opacity The relative change in opacity.
917 void OpacityBy(Actor actor, float opacity);
920 * @brief Animate the opacity of an actor.
922 * This overload allows the alpha function to be customized.
923 * The effect will start & end when the animation begins & ends.
924 * @param [in] actor The actor to animate.
925 * @param [in] opacity The relative change in opacity.
926 * @param [in] alpha The alpha function to apply.
928 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha);
931 * @brief Animate the opacity of an actor.
933 * This overload allows the animation start & end time to be customized.
934 * @pre delaySeconds must be zero or greater.
935 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
936 * @param [in] actor The actor to animate.
937 * @param [in] opacity The relative change in opacity.
938 * @param [in] alpha The alpha function to apply.
939 * @param [in] delaySeconds The initial delay from the start of the animation.
940 * @param [in] durationSeconds The duration of the opacity animation.
942 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
945 * @brief Animate an actor to a target opacity.
947 * The default alpha function will be used.
948 * The effect will start & end when the animation begins & ends.
949 * @param [in] actor The actor to animate.
950 * @param [in] opacity The target opacity.
952 void OpacityTo(Actor actor, float opacity);
955 * @brief Animate an actor to a target opacity.
957 * This overload allows the alpha function to be customized.
958 * The effect will start & end when the animation begins & ends.
959 * @param [in] actor The actor to animate.
960 * @param [in] opacity The target opacity.
961 * @param [in] alpha The alpha function to apply.
963 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha);
966 * @brief Animate an actor to a target opacity.
968 * This overload allows the animation start & end time to be customized.
969 * @pre delaySeconds must be zero or greater.
970 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
971 * @param [in] actor The actor to animate.
972 * @param [in] opacity The target opacity.
973 * @param [in] alpha The alpha function to apply.
974 * @param [in] delaySeconds The initial delay from the start of the animation.
975 * @param [in] durationSeconds The duration of the opacity animation.
977 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
980 * @brief Animate the color of an actor.
982 * The default alpha function will be used.
983 * The effect will start & end when the animation begins & ends.
984 * @param [in] actor The actor to animate.
985 * @param [in] color The relative change in color.
987 void ColorBy(Actor actor, Vector4 color);
990 * @brief Animate the color of an actor.
992 * This overload allows the alpha function to be customized.
993 * The effect will start & end when the animation begins & ends.
994 * @param [in] actor The actor to animate.
995 * @param [in] color The relative change in color.
996 * @param [in] alpha The alpha function to apply.
998 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha);
1001 * @brief Animate the color of an actor.
1003 * This overload allows the animation start & end time to be customized.
1004 * @pre delaySeconds must be zero or greater.
1005 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1006 * @param [in] actor The actor to animate.
1007 * @param [in] color The relative change in color.
1008 * @param [in] alpha The alpha function to apply.
1009 * @param [in] delaySeconds The initial delay from the start of the animation.
1010 * @param [in] durationSeconds The duration of the color animation.
1012 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1015 * @brief Animate an actor to a target color.
1017 * The default alpha function will be used.
1018 * The effect will start & end when the animation begins & ends.
1019 * @param [in] actor The actor to animate.
1020 * @param [in] color The target color.
1022 void ColorTo(Actor actor, Vector4 color);
1025 * @brief Animate an actor to a target color.
1027 * This overload allows the alpha function to be customized.
1028 * The effect will start & end when the animation begins & ends.
1029 * @param [in] actor The actor to animate.
1030 * @param [in] color The target color.
1031 * @param [in] alpha The alpha function to apply.
1033 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha);
1036 * @brief Animate an actor to a target color.
1038 * This overload allows the animation start & end time to be customized.
1039 * @pre delaySeconds must be zero or greater.
1040 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1041 * @param [in] actor The actor to animate.
1042 * @param [in] color The target color.
1043 * @param [in] alpha The alpha function to apply.
1044 * @param [in] delaySeconds The initial delay from the start of the animation.
1045 * @param [in] durationSeconds The duration of the color animation.
1047 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1050 * @brief Resize an actor.
1052 * The default alpha function will be used.
1053 * The resizing will start & end when the animation begins & ends.
1054 * The depth defaults to the minimum of width & height.
1055 * @param [in] actor The actor to animate.
1056 * @param [in] width The target width.
1057 * @param [in] height The target height.
1059 void Resize(Actor actor, float width, float height);
1062 * @brief Resize an actor.
1064 * This overload allows the alpha function to be customized.
1065 * The resizing will start & end when the animation begins & ends.
1066 * The depth defaults to the minimum of width & height.
1067 * @param [in] actor The actor to animate.
1068 * @param [in] width The target width.
1069 * @param [in] height The target height.
1070 * @param [in] alpha The alpha function to apply.
1072 void Resize(Actor actor, float width, float height, AlphaFunction alpha);
1075 * @brief Resize an actor.
1077 * This overload allows the resizing start & end time to be customized.
1078 * The depth defaults to the minimum of width & height.
1079 * @pre delaySeconds must be zero or greater.
1080 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1081 * @param [in] actor The actor to animate.
1082 * @param [in] width The target width.
1083 * @param [in] height The target height.
1084 * @param [in] alpha The alpha function to apply.
1085 * @param [in] delaySeconds The initial delay from the start of the animation.
1086 * @param [in] durationSeconds The duration of the resizing.
1088 void Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1091 * @brief Resize an actor.
1093 * The default alpha function will be used.
1094 * The resizing will start & end when the animation begins & ends.
1095 * @param [in] actor The actor to animate.
1096 * @param [in] size The target size.
1098 void Resize(Actor actor, Vector3 size);
1101 * @brief Resize an actor.
1103 * This overload allows the alpha function to be customized.
1104 * The resizing will start & end when the animation begins & ends.
1105 * @param [in] actor The actor to animate.
1106 * @param [in] size The target size.
1107 * @param [in] alpha The alpha function to apply.
1109 void Resize(Actor actor, Vector3 size, AlphaFunction alpha);
1112 * @brief Resize an actor.
1114 * This overload allows the resizing start & end time to be customized.
1115 * @pre delaySeconds must be zero or greater.
1116 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1117 * @param [in] actor The actor to animate.
1118 * @param [in] size The target size.
1119 * @param [in] alpha The alpha function to apply.
1120 * @param [in] delaySeconds The initial delay from the start of the animation.
1121 * @param [in] durationSeconds The duration of the resizing.
1123 void Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1125 public: // Not intended for use by Application developers
1128 * @brief This constructor is used by Dali New() methods
1129 * @param [in] animation A pointer to a newly allocated Dali resource
1131 explicit DALI_INTERNAL Animation(Internal::Animation* animation);
1137 #endif // __DALI_ANIMATION_H__