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.
102 * | %Signal Name | Method |
103 * |--------------|--------------------------|
104 * | finished | @ref FinishedSignal() |
107 * | %Action Name | %Animation method called |
108 * |--------------|--------------------------|
111 * | pause | Pause() |
113 class DALI_IMPORT_API Animation : public BaseHandle
117 typedef Signal< void (Animation&) > AnimationSignalType; ///< Animation finished signal type
119 typedef Any AnyFunction; ///< Interpolation function
122 * @brief What to do when the animation ends, is stopped or is destroyed
126 Bake, ///< When the animation ends, the animated property values are saved.
127 Discard, ///< When the animation ends, the animated property values are forgotten.
128 BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake.
132 * @brief What interpolation method to use on key-frame animations
136 Linear, ///< Values in between key frames are interpolated using a linear polynomial. (Default)
137 Cubic ///< Values in between key frames are interpolated using a cubic polynomial.
141 * @brief Create an uninitialized Animation; this can be initialized with Animation::New().
143 * Calling member functions with an uninitialized Dali::Object is not allowed.
148 * @brief Create an initialized Animation.
150 * The animation will not loop.
151 * The default end action is "Bake".
152 * The default alpha function is linear.
153 * @pre durationSeconds must be greater than zero.
154 * @param [in] durationSeconds The duration in seconds.
155 * @return A handle to a newly allocated Dali resource.
157 static Animation New(float durationSeconds);
160 * @brief Downcast an Object handle to Animation.
162 * If handle points to an Animation object the downcast produces
163 * valid handle. If not the returned handle is left uninitialized.
165 * @param[in] handle to An object
166 * @return handle to a Animation object or an uninitialized handle
168 static Animation DownCast( BaseHandle handle );
173 * This is non-virtual since derived Handle types must not contain data or virtual methods.
178 * @brief This copy constructor is required for (smart) pointer semantics.
180 * @param [in] handle A reference to the copied handle
182 Animation(const Animation& handle);
185 * @brief This assignment operator is required for (smart) pointer semantics.
187 * @param [in] rhs A reference to the copied handle
188 * @return A reference to this
190 Animation& operator=(const Animation& rhs);
193 * @brief Set the duration of an animation.
195 * @pre durationSeconds must be greater than zero.
196 * @param[in] seconds The duration in seconds.
198 void SetDuration(float seconds);
201 * @brief Retrieve the duration of an animation.
203 * @return The duration in seconds.
205 float GetDuration() const;
208 * @brief Set whether the animation will loop.
210 * @param[in] looping True if the animation will loop.
212 void SetLooping(bool looping);
215 * @brief Query whether the animation will loop.
217 * @return True if the animation will loop.
219 bool IsLooping() const;
222 * @brief Set the end action of the animation.
224 * This action is performed when the animation ends or if it is stopped.
225 * Default end action is bake
226 * @param[in] action The end action.
228 void SetEndAction(EndAction action);
231 * @brief Returns the end action of the animation.
233 * @return The end action.
235 EndAction GetEndAction() const;
238 * @brief Set the disconnect action.
240 * If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
241 * Default action is to BakeFinal.
242 * @param[in] disconnectAction The disconnect action.
244 void SetDisconnectAction( EndAction disconnectAction );
247 * @brief Returns the disconnect action.
249 * @return The disconnect action.
251 EndAction GetDisconnectAction() const;
254 * @brief Set the default alpha function for an animation.
256 * This is applied to individual property animations, if no further alpha functions are supplied.
257 * @param[in] alpha The default alpha function.
259 void SetDefaultAlphaFunction(AlphaFunction alpha);
262 * @brief Retrieve the default alpha function for an animation.
264 * @return The default alpha function.
266 AlphaFunction GetDefaultAlphaFunction() const;
269 * @brief Sets the progress of the animation.
270 * The animation will play (or continue playing) from this point. The progress
271 * must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
272 * otherwise, it will be ignored.
274 * @param[in] progress The new progress as a normalized value between [0,1] or between the
275 * play range if specified.
277 void SetCurrentProgress( float progress );
280 * @brief Retrieve the current progress of the animation.
282 * @return The current progress as a normalized value between [0,1].
284 float GetCurrentProgress();
287 * @brief Specifies an speed factor for the animation.
289 * The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will
290 * slow down the animation and values above one will speed up the animation. It is also possible to specify a negative multiplier
291 * to play the animation in reverse.
293 * @param[in] factor A value which will multiply the velocity.
295 void SetSpeedFactor( float factor );
298 * @brief Retrieve the speed factor of the animation
300 * @return speed factor
302 float GetSpeedFactor() const;
305 * @brief Set the playing range.
306 * Animation will play between the values specified. Both values ( range.x and range.y ) should be between 0-1,
307 * otherwise they will be ignored. If the range provided is not in proper order ( minimum,maximum ), it will be reordered.
309 * @param[in] range Two values between [0,1] to specify minimum and maximum progress. The
310 * animation will play between those values.
312 void SetPlayRange( const Vector2& range );
315 * @brief Get the playing range
317 * @return The play range defined for the animation.
319 Vector2 GetPlayRange() const;
322 * @brief Play the animation.
327 * @brief Play the animation from a given point.
328 * The progress must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
329 * otherwise, it will be ignored.
331 * @param[in] progress A value between [0,1], or between the play range if specified, form where the animation should start playing
333 void PlayFrom( float progress );
336 * @brief Pause the animation.
341 * @brief Stop the animation.
346 * @brief Clear the animation.
348 * This disconnects any objects that were being animated, effectively stopping the animation.
353 * @brief Connect to this signal to be notified when an Animation's animations have finished.
355 * @return A signal object to Connect() with.
357 AnimationSignalType& FinishedSignal();
360 * @brief Animate a property value by a relative amount.
362 * The default alpha function will be used.
363 * The effect will start & end when the animation begins & ends.
364 * @param [in] target The target object/property to animate.
365 * @param [in] relativeValue The property value will change by this amount.
367 void AnimateBy(Property target, Property::Value relativeValue);
370 * @brief Animate a property value by a relative amount.
372 * The effect will start & end when the animation begins & ends.
373 * @param [in] target The target object/property to animate.
374 * @param [in] relativeValue The property value will change by this amount.
375 * @param [in] alpha The alpha function to apply.
377 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha);
380 * @brief Animate a property value by a relative amount.
382 * The default alpha function will be used.
383 * @param [in] target The target object/property to animate.
384 * @param [in] relativeValue The property value will increase/decrease by this amount.
385 * @param [in] period The effect will occur during this time period.
387 void AnimateBy(Property target, Property::Value relativeValue, TimePeriod period);
390 * @brief Animate a property value by a relative amount.
392 * @param [in] target The target object/property to animate.
393 * @param [in] relativeValue The property value will increase/decrease by this amount.
394 * @param [in] alpha The alpha function to apply.
395 * @param [in] period The effect will occur during this time period.
397 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period);
400 * @brief Animate a property to a destination value.
402 * The default alpha function will be used.
403 * The effect will start & end when the animation begins & ends.
404 * @param [in] target The target object/property to animate.
405 * @param [in] destinationValue The destination value.
407 void AnimateTo(Property target, Property::Value destinationValue);
410 * @brief Animate a property to a destination value.
412 * The effect will start & end when the animation begins & ends.
413 * @param [in] target The target object/property to animate.
414 * @param [in] destinationValue The destination value.
415 * @param [in] alpha The alpha function to apply.
417 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha);
420 * @brief Animate a property to a destination value.
422 * The default alpha function will be used.
423 * @param [in] target The target object/property to animate.
424 * @param [in] destinationValue The destination value.
425 * @param [in] period The effect will occur during this time period.
427 void AnimateTo(Property target, Property::Value destinationValue, TimePeriod period);
430 * @brief Animate a property to a destination value.
432 * @param [in] target The target object/property to animate.
433 * @param [in] destinationValue The destination value.
434 * @param [in] alpha The alpha function to apply.
435 * @param [in] period The effect will occur during this time period.
437 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
440 * @brief Animate a property between keyframes.
442 * @param [in] target The target object/property to animate.
443 * @param [in] keyFrames The key frames
445 void AnimateBetween(Property target, KeyFrames& keyFrames);
448 * @brief Animate a property between keyframes.
450 * @param [in] target The target object + property to animate
451 * @param [in] keyFrames The set of time / value pairs between which to animate.
452 * @param [in] interpolation The method used to interpolate between values.
454 void AnimateBetween(Property target, KeyFrames& keyFrames, Interpolation interpolation);
457 * @brief Animate a property between keyframes.
459 * @param [in] target The target object/property to animate.
460 * @param [in] keyFrames The key frames
461 * @param [in] alpha The alpha function to apply.
463 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha);
466 * @brief Animate a property between keyframes.
468 * @param [in] target The target object + property to animate
469 * @param [in] keyFrames The set of time / value pairs between which to animate.
470 * @param [in] alpha The alpha function to apply.
471 * @param [in] interpolation The method used to interpolate between values.
473 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation);
476 * @brief Animate a property between keyframes.
478 * @param [in] target The target object/property to animate.
479 * @param [in] keyFrames The key frames
480 * @param [in] period The effect will occur during this time period.
482 void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period);
485 * @brief Animate a property between keyframes.
487 * @param [in] target The target object + property to animate
488 * @param [in] keyFrames The set of time / value pairs between which to animate.
489 * @param [in] period The effect will occur duing this time period.
490 * @param [in] interpolation The method used to interpolate between values.
492 void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation);
495 * @brief Animate a property between keyframes.
497 * @param [in] target The target object/property to animate.
498 * @param [in] keyFrames The key frames
499 * @param [in] alpha The alpha function to apply.
500 * @param [in] period The effect will occur during this time period.
502 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
505 * @brief Animate a property between keyframes.
507 * @param [in] target The target object + property to animate
508 * @param [in] keyFrames The set of time / value pairs between which to animate.
509 * @param [in] alpha The alpha function to apply to the overall progress.
510 * @param [in] period The effect will occur duing this time period.
511 * @param [in] interpolation The method used to interpolate between values.
513 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation);
516 // Actor-specific convenience methods
519 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
520 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
522 * @param[in] actor The actor to animate
523 * @param[in] path The path. It defines position and orientation
524 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
526 void Animate( Actor actor, Path path, const Vector3& forward );
529 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
530 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
532 * @param[in] actor The actor to animate
533 * @param[in] path The path. It defines position and orientation
534 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
535 * @param [in] alpha The alpha function to apply.
537 void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha );
540 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
541 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
543 * @param[in] actor The actor to animate
544 * @param[in] path The path. It defines position and orientation
545 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
546 * @param [in] period The effect will occur during this time period.
548 void Animate( Actor actor, Path path, const Vector3& forward, TimePeriod period );
551 * @brief Animate an actor's position and orientation through a predefined path. The actor will rotate to orient the supplied
552 * forward vector with the path's tangent. If forward is the zero vector then no rotation will happen.
554 * @param[in] actor The actor to animate
555 * @param[in] path The path. It defines position and orientation
556 * @param[in] forward The vector (in local space coordinate system) that will be oriented with the path's tangent direction
557 * @param [in] alpha The alpha function to apply.
558 * @param [in] period The effect will occur during this time period.
560 void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period);
563 * @brief Move an actor relative to its position.
565 * The default alpha function will be used.
566 * The move will start & end when the animation begins & ends.
567 * @param [in] actor The actor to animate.
568 * @param [in] x axis displacement.
569 * @param [in] y axis displacement.
570 * @param [in] z axis displacement.
572 void MoveBy(Actor actor, float x, float y, float z);
575 * @brief Move an actor relative to its position.
577 * This overload allows the alpha function to be customized.
578 * The move will start & end when the animation begins & ends.
579 * @param [in] actor The actor to animate.
580 * @param [in] displacement relative to current position.
581 * @param [in] alpha The alpha function to apply.
583 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha);
586 * @brief Move an actor relative to its position.
588 * This overload allows the translation start & end time to be customized.
589 * @pre delaySeconds must be zero or greater.
590 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
591 * @param [in] actor The actor to animate.
592 * @param [in] displacement relative to current position.
593 * @param [in] alpha The alpha function to apply.
594 * @param [in] delaySeconds The initial delay from the start of the animation.
595 * @param [in] durationSeconds The duration of the translation.
597 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds);
600 * @brief Move an actor to a target position.
602 * The default alpha function will be used.
603 * The move will start & end when the animation begins & ends.
604 * @param [in] actor The actor to animate.
605 * @param [in] x axis position.
606 * @param [in] y axis position.
607 * @param [in] z axis position.
609 void MoveTo(Actor actor, float x, float y, float z);
612 * @brief Move an actor to a target position.
614 * This overload allows the alpha function to be customized.
615 * The move will start & end when the animation begins & ends.
616 * @param [in] actor The actor to animate.
617 * @param [in] position to move to
618 * @param [in] alpha The alpha function to apply.
620 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha);
623 * @brief Move an actor to a target position.
625 * This overload allows the translation start & end time to be customized.
626 * @pre delaySeconds must be zero or greater.
627 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
628 * @param [in] actor The actor to animate.
629 * @param [in] position to move to
630 * @param [in] alpha The alpha function to apply.
631 * @param [in] delaySeconds The initial delay from the start of the animation.
632 * @param [in] durationSeconds The duration of the translation.
634 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds);
637 * @brief Rotate an actor around an arbitrary axis.
639 * The default alpha function will be used.
640 * The rotation will start & end when the animation begins & ends.
641 * @param [in] actor The actor to animate.
642 * @param [in] angle The angle in degrees.
643 * @param [in] axis The axis to rotate around
645 void RotateBy(Actor actor, Degree angle, Vector3 axis);
648 * @brief Rotate an actor around an arbitrary axis.
650 * The default alpha function will be used.
651 * The rotation will start & end when the animation begins & ends.
652 * @param [in] actor The actor to animate.
653 * @param [in] angle The angle in radians.
654 * @param [in] axis The axis to rotate around
656 void RotateBy(Actor actor, Radian angle, Vector3 axis);
659 * @brief Rotate an actor around an arbitrary axis.
661 * This overload allows the alpha function to be customized.
662 * The rotation will start & end when the animation begins & ends.
663 * @param [in] actor The actor to animate.
664 * @param [in] angle The angle in radians.
665 * @param [in] axis The axis to rotate around.
666 * @param [in] alpha The alpha function to apply.
668 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
671 * @brief Rotate an actor around an arbitrary axis.
673 * This overload allows the alpha function to be customized.
674 * The rotation will start & end when the animation begins & ends.
675 * @param [in] actor The actor to animate.
676 * @param [in] angle The angle in radians.
677 * @param [in] axis The axis to rotate around.
678 * @param [in] alpha The alpha function to apply.
680 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
683 * @brief Rotate an actor around an arbitrary axis.
685 * This overload allows the rotation start & end time to be customized.
686 * @pre delaySeconds must be zero or greater.
687 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
688 * @param [in] actor The actor to animate.
689 * @param [in] angle The angle in degrees.
690 * @param [in] axis The axis to rotate around
691 * @param [in] alpha The alpha function to apply.
692 * @param [in] delaySeconds The initial delay from the start of the animation.
693 * @param [in] durationSeconds The duration of the rotation.
695 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
698 * @brief Rotate an actor around an arbitrary axis.
700 * This overload allows the rotation start & end time to be customized.
701 * @pre delaySeconds must be zero or greater.
702 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
703 * @param [in] actor The actor to animate.
704 * @param [in] angle The angle in radians.
705 * @param [in] axis The axis to rotate around
706 * @param [in] alpha The alpha function to apply.
707 * @param [in] delaySeconds The initial delay from the start of the animation.
708 * @param [in] durationSeconds The duration of the rotation.
710 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
713 * @brief Rotate an actor to a target orientation.
715 * The default alpha function will be used.
716 * The rotation will start & end when the animation begins & ends.
717 * @param [in] actor The actor to animate.
718 * @param [in] angle The target rotation angle in degrees.
719 * @param [in] axis The target axis of rotation.
721 void RotateTo(Actor actor, Degree angle, Vector3 axis);
724 * @brief Rotate an actor to a target orientation.
726 * The default alpha function will be used.
727 * The rotation will start & end when the animation begins & ends.
728 * @param [in] actor The actor to animate.
729 * @param [in] angle The target rotation angle in radians.
730 * @param [in] axis The target axis of rotation.
732 void RotateTo(Actor actor, Radian angle, Vector3 axis);
735 * @brief Rotate an actor to a target orientation.
737 * The default alpha function will be used.
738 * The rotation will start & end when the animation begins & ends.
739 * @param [in] actor The actor to animate.
740 * @param [in] orientation The target orientation.
742 void RotateTo(Actor actor, Quaternion orientation);
745 * @brief Rotate an actor to a target orientation.
747 * This overload allows the alpha function to be customized.
748 * The rotation will start & end when the animation begins & ends.
749 * @param [in] actor The actor to animate.
750 * @param [in] angle The target rotation angle in degrees.
751 * @param [in] axis The target axis of rotation.
752 * @param [in] alpha The alpha function to apply.
754 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
757 * @brief Rotate an actor to a target orientation.
759 * This overload allows the alpha function to be customized.
760 * The rotation will start & end when the animation begins & ends.
761 * @param [in] actor The actor to animate.
762 * @param [in] angle The target rotation angle in radians.
763 * @param [in] axis The target axis of rotation.
764 * @param [in] alpha The alpha function to apply.
766 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
769 * @brief Rotate an actor to a target orientation.
771 * This overload allows the alpha function to be customized.
772 * The rotation will start & end when the animation begins & ends.
773 * @param [in] actor The actor to animate.
774 * @param [in] orientation The target orientation.
775 * @param [in] alpha The alpha function to apply.
777 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha);
780 * @brief Rotate an actor to a target orientation.
782 * This overload allows the rotation start & end time to be customized.
783 * @pre delaySeconds must be zero or greater.
784 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
785 * @param [in] actor The actor to animate.
786 * @param [in] angle The target rotation angle in degrees.
787 * @param [in] axis The target axis of rotation.
788 * @param [in] alpha The alpha function to apply.
789 * @param [in] delaySeconds The initial delay from the start of the animation.
790 * @param [in] durationSeconds The duration of the rotation.
792 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
795 * @brief Rotate an actor to a target orientation.
797 * This overload allows the rotation start & end time to be customized.
798 * @pre delaySeconds must be zero or greater.
799 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
800 * @param [in] actor The actor to animate.
801 * @param [in] angle The target rotation angle in radians.
802 * @param [in] axis The target axis of rotation.
803 * @param [in] alpha The alpha function to apply.
804 * @param [in] delaySeconds The initial delay from the start of the animation.
805 * @param [in] durationSeconds The duration of the rotation.
807 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
810 * @brief Rotate an actor to a target orientation.
812 * This overload allows the rotation start & end time to be customized.
813 * @pre delaySeconds must be zero or greater.
814 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
815 * @param [in] actor The actor to animate.
816 * @param [in] orientation The target orientation.
817 * @param [in] alpha The alpha function to apply.
818 * @param [in] delaySeconds The initial delay from the start of the animation.
819 * @param [in] durationSeconds The duration of the rotation.
821 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
824 * @brief Scale an actor.
826 * The default alpha function will be used.
827 * The scaling will start & end when the animation begins & ends.
828 * @param [in] actor The actor to animate.
829 * @param [in] x Scale factor in the X-direction.
830 * @param [in] y Scale factor in the Y-direction.
831 * @param [in] z Scale factor in the Z-direction.
833 void ScaleBy(Actor actor, float x, float y, float z);
836 * @brief Scale an actor.
838 * This overload allows the alpha function to be customized.
839 * The scaling will start & end when the animation begins & ends.
840 * @param [in] actor The actor to animate.
841 * @param [in] scale The scale factor.
842 * @param [in] alpha The alpha function to apply.
844 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha);
847 * @brief Scale an actor.
849 * This overload allows the scaling start & end time to be customized.
850 * @pre delaySeconds must be zero or greater.
851 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
852 * @param [in] actor The actor to animate.
853 * @param [in] scale The scale factor.
854 * @param [in] alpha The alpha function to apply.
855 * @param [in] delaySeconds The initial delay from the start of the animation.
856 * @param [in] durationSeconds The duration of the scaling.
858 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
861 * @brief Scale an actor to a target scale factor.
863 * The default alpha function will be used.
864 * The scaling will start & end when the animation begins & ends.
865 * @param [in] actor The actor to animate.
866 * @param [in] x Target scale-factor in the X-direction.
867 * @param [in] y Target scale-factor in the Y-direction.
868 * @param [in] z Target scale-factor in the Z-direction.
870 void ScaleTo(Actor actor, float x, float y, float z);
873 * @brief Scale an actor to a target scale factor.
875 * This overload allows the alpha function to be customized.
876 * The scaling will start & end when the animation begins & ends.
877 * @param [in] actor The actor to animate.
878 * @param [in] scale The target scale factor.
879 * @param [in] alpha The alpha function to apply.
881 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha);
884 * @brief Scale an actor to a target scale factor.
886 * This overload allows the scaling start & end time to be customized.
887 * @pre delaySeconds must be zero or greater.
888 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
889 * @param [in] actor The actor to animate.
890 * @param [in] scale The target scale factor.
891 * @param [in] alpha The alpha function to apply.
892 * @param [in] delaySeconds The initial delay from the start of the animation.
893 * @param [in] durationSeconds The duration of the scaling.
895 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
898 * @brief Show an actor during the animation.
900 * @param [in] actor The actor to animate.
901 * @param [in] delaySeconds The initial delay from the start of the animation.
903 void Show(Actor actor, float delaySeconds);
906 * @brief Hide an actor during the animation.
908 * @param [in] actor The actor to animate.
909 * @param [in] delaySeconds The initial delay from the start of the animation.
911 void Hide(Actor actor, float delaySeconds);
914 * @brief Animate the opacity of an actor.
916 * The default alpha function will be used.
917 * The effect will start & end when the animation begins & ends.
918 * @param [in] actor The actor to animate.
919 * @param [in] opacity The relative change in opacity.
921 void OpacityBy(Actor actor, float opacity);
924 * @brief Animate the opacity of an actor.
926 * This overload allows the alpha function to be customized.
927 * The effect will start & end when the animation begins & ends.
928 * @param [in] actor The actor to animate.
929 * @param [in] opacity The relative change in opacity.
930 * @param [in] alpha The alpha function to apply.
932 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha);
935 * @brief Animate the opacity of an actor.
937 * This overload allows the animation start & end time to be customized.
938 * @pre delaySeconds must be zero or greater.
939 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
940 * @param [in] actor The actor to animate.
941 * @param [in] opacity The relative change in opacity.
942 * @param [in] alpha The alpha function to apply.
943 * @param [in] delaySeconds The initial delay from the start of the animation.
944 * @param [in] durationSeconds The duration of the opacity animation.
946 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
949 * @brief Animate an actor to a target opacity.
951 * The default alpha function will be used.
952 * The effect will start & end when the animation begins & ends.
953 * @param [in] actor The actor to animate.
954 * @param [in] opacity The target opacity.
956 void OpacityTo(Actor actor, float opacity);
959 * @brief Animate an actor to a target opacity.
961 * This overload allows the alpha function to be customized.
962 * The effect will start & end when the animation begins & ends.
963 * @param [in] actor The actor to animate.
964 * @param [in] opacity The target opacity.
965 * @param [in] alpha The alpha function to apply.
967 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha);
970 * @brief Animate an actor to a target opacity.
972 * This overload allows the animation start & end time to be customized.
973 * @pre delaySeconds must be zero or greater.
974 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
975 * @param [in] actor The actor to animate.
976 * @param [in] opacity The target opacity.
977 * @param [in] alpha The alpha function to apply.
978 * @param [in] delaySeconds The initial delay from the start of the animation.
979 * @param [in] durationSeconds The duration of the opacity animation.
981 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
984 * @brief Animate the color of an actor.
986 * The default alpha function will be used.
987 * The effect will start & end when the animation begins & ends.
988 * @param [in] actor The actor to animate.
989 * @param [in] color The relative change in color.
991 void ColorBy(Actor actor, Vector4 color);
994 * @brief Animate the color of an actor.
996 * This overload allows the alpha function to be customized.
997 * The effect will start & end when the animation begins & ends.
998 * @param [in] actor The actor to animate.
999 * @param [in] color The relative change in color.
1000 * @param [in] alpha The alpha function to apply.
1002 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha);
1005 * @brief Animate the color of an actor.
1007 * This overload allows the animation start & end time to be customized.
1008 * @pre delaySeconds must be zero or greater.
1009 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1010 * @param [in] actor The actor to animate.
1011 * @param [in] color The relative change in color.
1012 * @param [in] alpha The alpha function to apply.
1013 * @param [in] delaySeconds The initial delay from the start of the animation.
1014 * @param [in] durationSeconds The duration of the color animation.
1016 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1019 * @brief Animate an actor to a target color.
1021 * The default alpha function will be used.
1022 * The effect will start & end when the animation begins & ends.
1023 * @param [in] actor The actor to animate.
1024 * @param [in] color The target color.
1026 void ColorTo(Actor actor, Vector4 color);
1029 * @brief Animate an actor to a target color.
1031 * This overload allows the alpha function to be customized.
1032 * The effect will start & end when the animation begins & ends.
1033 * @param [in] actor The actor to animate.
1034 * @param [in] color The target color.
1035 * @param [in] alpha The alpha function to apply.
1037 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha);
1040 * @brief Animate an actor to a target color.
1042 * This overload allows the animation start & end time to be customized.
1043 * @pre delaySeconds must be zero or greater.
1044 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1045 * @param [in] actor The actor to animate.
1046 * @param [in] color The target color.
1047 * @param [in] alpha The alpha function to apply.
1048 * @param [in] delaySeconds The initial delay from the start of the animation.
1049 * @param [in] durationSeconds The duration of the color animation.
1051 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1054 * @brief Resize an actor.
1056 * The default alpha function will be used.
1057 * The resizing will start & end when the animation begins & ends.
1058 * The depth defaults to the minimum of width & height.
1059 * @param [in] actor The actor to animate.
1060 * @param [in] width The target width.
1061 * @param [in] height The target height.
1063 void Resize(Actor actor, float width, float height);
1066 * @brief Resize an actor.
1068 * This overload allows the alpha function to be customized.
1069 * The resizing will start & end when the animation begins & ends.
1070 * The depth defaults to the minimum of width & height.
1071 * @param [in] actor The actor to animate.
1072 * @param [in] width The target width.
1073 * @param [in] height The target height.
1074 * @param [in] alpha The alpha function to apply.
1076 void Resize(Actor actor, float width, float height, AlphaFunction alpha);
1079 * @brief Resize an actor.
1081 * This overload allows the resizing start & end time to be customized.
1082 * The depth defaults to the minimum of width & height.
1083 * @pre delaySeconds must be zero or greater.
1084 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1085 * @param [in] actor The actor to animate.
1086 * @param [in] width The target width.
1087 * @param [in] height The target height.
1088 * @param [in] alpha The alpha function to apply.
1089 * @param [in] delaySeconds The initial delay from the start of the animation.
1090 * @param [in] durationSeconds The duration of the resizing.
1092 void Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1095 * @brief Resize an actor.
1097 * The default alpha function will be used.
1098 * The resizing will start & end when the animation begins & ends.
1099 * @param [in] actor The actor to animate.
1100 * @param [in] size The target size.
1102 void Resize(Actor actor, Vector3 size);
1105 * @brief Resize an actor.
1107 * This overload allows the alpha function to be customized.
1108 * The resizing will start & end when the animation begins & ends.
1109 * @param [in] actor The actor to animate.
1110 * @param [in] size The target size.
1111 * @param [in] alpha The alpha function to apply.
1113 void Resize(Actor actor, Vector3 size, AlphaFunction alpha);
1116 * @brief Resize an actor.
1118 * This overload allows the resizing start & end time to be customized.
1119 * @pre delaySeconds must be zero or greater.
1120 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1121 * @param [in] actor The actor to animate.
1122 * @param [in] size The target size.
1123 * @param [in] alpha The alpha function to apply.
1124 * @param [in] delaySeconds The initial delay from the start of the animation.
1125 * @param [in] durationSeconds The duration of the resizing.
1127 void Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1129 public: // Not intended for use by Application developers
1132 * @brief This constructor is used by Dali New() methods
1133 * @param [in] animation A pointer to a newly allocated Dali resource
1135 explicit DALI_INTERNAL Animation(Internal::Animation* animation);
1141 #endif // __DALI_ANIMATION_H__