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/time-period.h>
25 #include <dali/public-api/object/any.h>
26 #include <dali/public-api/object/handle.h>
27 #include <dali/public-api/object/property.h>
28 #include <dali/public-api/signals/dali-signal-v2.h>
43 namespace Internal DALI_INTERNAL
49 * @brief Dali::Animation can be used to animate the properties of any number of objects, typically Actors.
51 * An example animation setup is shown below:
57 * Actor mActor; // The object we wish to animate
58 * Animation mAnimation; // Keep this to control the animation
61 * // ...To play the animation
63 * mAnimation = Animation::New(3.0f); // duration 3 seconds
64 * mAnimation.MoveTo(mActor, 10.0f, 50.0f, 0.0f);
69 * Dali::Animation supports "fire and forget" behaviour i.e. an animation continues to play if the handle is discarded.
70 * Note that in the following example, the "Finish" signal will be emitted:
74 * void ExampleCallback( Animation& source )
76 * std::cout << "Animation has finished" << std::endl;
79 * void ExampleAnimation( Actor actor )
81 * Animation animation = Animation::New(2.0f); // duration 2 seconds
82 * animation.MoveTo(actor, 10.0f, 50.0f, 0.0f);
83 * animation.FinishedSignal().Connect( ExampleCallback );
85 * } // At this point the animation handle has gone out of scope
87 * Actor actor = Actor::New();
88 * Stage::GetCurrent().Add( actor );
90 * // Fire animation and forget about it
91 * ExampleAnimation( actor );
93 * // However the animation will continue, and "Animation has finished" will be printed after 2 seconds.
97 * If the "Finish" signal is connected to a member function of an object, it must be disconnected before the object is destroyed.
98 * This is typically done in the object destructor, and requires either the Dali::Connection object or Dali::Animation handle to be stored.
100 class DALI_IMPORT_API Animation : public BaseHandle
104 typedef SignalV2< void (Animation&) > AnimationSignalV2; ///< Animation finished signal type
106 typedef Any AnyFunction; ///< Interpolation function
109 * @brief What to do when the animation ends, is stopped or is destroyed
113 Bake, ///< When the animation ends, the animated property values are saved.
114 Discard, ///< When the animation ends, the animated property values are forgotten.
115 BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake.
119 static const char* const SIGNAL_FINISHED; ///< name "finished"
122 static const char* const ACTION_PLAY; ///< name "play"
123 static const char* const ACTION_STOP; ///< name "stop"
124 static const char* const ACTION_PAUSE; ///< name "pause"
127 * @brief Create an uninitialized Animation; this can be initialized with Animation::New().
129 * Calling member functions with an uninitialized Dali::Object is not allowed.
134 * @brief Create an initialized Animation.
136 * The animation will not loop.
137 * The default end action is "Bake".
138 * The default alpha function is linear.
139 * @pre durationSeconds must be greater than zero.
140 * @param [in] durationSeconds The duration in seconds.
141 * @return A handle to a newly allocated Dali resource.
143 static Animation New(float durationSeconds);
146 * @brief Downcast an Object handle to Animation.
148 * If handle points to an Animation object the downcast produces
149 * valid handle. If not the returned handle is left uninitialized.
151 * @param[in] handle to An object
152 * @return handle to a Animation object or an uninitialized handle
154 static Animation DownCast( BaseHandle handle );
159 * This is non-virtual since derived Handle types must not contain data or virtual methods.
164 * @brief This copy constructor is required for (smart) pointer semantics.
166 * @param [in] handle A reference to the copied handle
168 Animation(const Animation& handle);
171 * @brief This assignment operator is required for (smart) pointer semantics.
173 * @param [in] rhs A reference to the copied handle
174 * @return A reference to this
176 Animation& operator=(const Animation& rhs);
179 * @brief Set the duration of an animation.
181 * @pre durationSeconds must be greater than zero.
182 * @param[in] seconds The duration in seconds.
184 void SetDuration(float seconds);
187 * @brief Retrieve the duration of an animation.
189 * @return The duration in seconds.
191 float GetDuration() const;
194 * @brief Set whether the animation will loop.
196 * @param[in] looping True if the animation will loop.
198 void SetLooping(bool looping);
201 * @brief Query whether the animation will loop.
203 * @return True if the animation will loop.
205 bool IsLooping() const;
208 * @brief Set the end action of the animation.
210 * This action is performed when the animation ends or if it is stopped.
211 * Default end action is bake
212 * @param[in] action The end action.
214 void SetEndAction(EndAction action);
217 * @brief Returns the end action of the animation.
219 * @return The end action.
221 EndAction GetEndAction() const;
224 * @brief Set the disconnect action.
226 * If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
227 * Default action is to BakeFinal.
228 * @param[in] disconnectAction The disconnect action.
230 void SetDisconnectAction( EndAction disconnectAction );
233 * @brief Returns the disconnect action.
235 * @return The disconnect action.
237 EndAction GetDisconnectAction() const;
240 * @brief Set the default alpha function for an animation.
242 * This is applied to individual property animations, if no further alpha functions are supplied.
243 * @param[in] alpha The default alpha function.
245 void SetDefaultAlphaFunction(AlphaFunction alpha);
248 * @brief Retrieve the default alpha function for an animation.
250 * @return The default alpha function.
252 AlphaFunction GetDefaultAlphaFunction() const;
255 * @brief Sets the progress of the animation.
256 * The animation will play (or continue playing) from this point. The progress
257 * must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
258 * otherwise, it will be ignored.
260 * @param[in] progress The new progress as a normalized value between [0,1] or between the
261 * play range if specified.
263 void SetCurrentProgress( float progress );
266 * @brief Retrieve the current progress of the animation.
268 * @return The current progress as a normalized value between [0,1].
270 float GetCurrentProgress();
273 * @brief Specifies an speed factor for the animation.
275 * The speed factor is a multiplier of the normal velocity of the animation. Values between [0,1] will
276 * slow down the animation and values above one will speed up the animation. It is also possible to specify a negative multiplier
277 * to play the animation in reverse.
279 * @param[in] factor A value which will multiply the velocity.
281 void SetSpeedFactor( float factor );
284 * @brief Retrieve the speed factor of the animation
286 * @return speed factor
288 float GetSpeedFactor() const;
291 * @brief Set the playing range.
292 * Animation will play between the values specified. Both values ( range.x and range.y ) should be between 0-1,
293 * otherwise they will be ignored. If the range provided is not in proper order ( minimum,maximum ), it will be reordered.
295 * @param[in] range Two values between [0,1] to specify minimum and maximum progress. The
296 * animation will play between those values.
298 void SetPlayRange( const Vector2& range );
301 * @brief Get the playing range
303 * @return The play range defined for the animation.
305 Vector2 GetPlayRange() const;
308 * @brief Play the animation.
313 * @brief Play the animation from a given point.
314 * The progress must be in the 0-1 interval or in the play range interval if defined ( See SetPlayRange ),
315 * otherwise, it will be ignored.
317 * @param[in] progress A value between [0,1], or between the play range if specified, form where the animation should start playing
319 void PlayFrom( float progress );
322 * @brief Pause the animation.
327 * @brief Stop the animation.
332 * @brief Clear the animation.
334 * This disconnects any objects that were being animated, effectively stopping the animation.
339 * @brief Connect to this signal to be notified when an Animation's animations have finished.
341 * @return A signal object to Connect() with.
343 AnimationSignalV2& FinishedSignal();
346 * @brief Animate a property value by a relative amount.
348 * The default alpha function will be used.
349 * The effect will start & end when the animation begins & ends.
350 * @param [in] target The target object/property to animate.
351 * @param [in] relativeValue The property value will change by this amount.
353 void AnimateBy(Property target, Property::Value relativeValue);
356 * @brief Animate a property value by a relative amount.
358 * The effect will start & end when the animation begins & ends.
359 * @param [in] target The target object/property to animate.
360 * @param [in] relativeValue The property value will change by this amount.
361 * @param [in] alpha The alpha function to apply.
363 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha);
366 * @brief Animate a property value by a relative amount.
368 * The default alpha function will be used.
369 * @param [in] target The target object/property to animate.
370 * @param [in] relativeValue The property value will increase/decrease by this amount.
371 * @param [in] period The effect will occur during this time period.
373 void AnimateBy(Property target, Property::Value relativeValue, TimePeriod period);
376 * @brief Animate a property value by a relative amount.
378 * @param [in] target The target object/property to animate.
379 * @param [in] relativeValue The property value will increase/decrease by this amount.
380 * @param [in] alpha The alpha function to apply.
381 * @param [in] period The effect will occur during this time period.
383 void AnimateBy(Property target, Property::Value relativeValue, AlphaFunction alpha, TimePeriod period);
386 * @brief Animate a property to a destination value.
388 * The default alpha function will be used.
389 * The effect will start & end when the animation begins & ends.
390 * @param [in] target The target object/property to animate.
391 * @param [in] destinationValue The destination value.
393 void AnimateTo(Property target, Property::Value destinationValue);
396 * @brief Animate a property to a destination value.
398 * The effect will start & end when the animation begins & ends.
399 * @param [in] target The target object/property to animate.
400 * @param [in] destinationValue The destination value.
401 * @param [in] alpha The alpha function to apply.
403 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha);
406 * @brief Animate a property to a destination value.
408 * The default alpha function will be used.
409 * @param [in] target The target object/property to animate.
410 * @param [in] destinationValue The destination value.
411 * @param [in] period The effect will occur during this time period.
413 void AnimateTo(Property target, Property::Value destinationValue, TimePeriod period);
416 * @brief Animate a property to a destination value.
418 * @param [in] target The target object/property to animate.
419 * @param [in] destinationValue The destination value.
420 * @param [in] alpha The alpha function to apply.
421 * @param [in] period The effect will occur during this time period.
423 void AnimateTo(Property target, Property::Value destinationValue, AlphaFunction alpha, TimePeriod period);
426 * @brief Animate a property between keyframes.
428 * @param [in] target The target object/property to animate.
429 * @param [in] keyFrames The key frames
431 void AnimateBetween(Property target, KeyFrames& keyFrames);
434 * @brief Animate a property between keyframes.
436 * @param [in] target The target object/property to animate.
437 * @param [in] keyFrames The key frames
438 * @param [in] alpha The alpha function to apply.
440 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha);
443 * @brief Animate a property between keyframes.
445 * @param [in] target The target object/property to animate.
446 * @param [in] keyFrames The key frames
447 * @param [in] period The effect will occur during this time period.
449 void AnimateBetween(Property target, KeyFrames& keyFrames, TimePeriod period);
452 * @brief Animate a property between keyframes.
454 * @param [in] target The target object/property to animate.
455 * @param [in] keyFrames The key frames
456 * @param [in] alpha The alpha function to apply.
457 * @param [in] period The effect will occur during this time period.
459 void AnimateBetween(Property target, KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period);
461 // Actor-specific convenience methods
464 * @brief Move an actor relative to its position.
466 * The default alpha function will be used.
467 * The move will start & end when the animation begins & ends.
468 * @param [in] actor The actor to animate.
469 * @param [in] x axis displacement.
470 * @param [in] y axis displacement.
471 * @param [in] z axis displacement.
473 void MoveBy(Actor actor, float x, float y, float z);
476 * @brief Move an actor relative to its position.
478 * This overload allows the alpha function to be customized.
479 * The move will start & end when the animation begins & ends.
480 * @param [in] actor The actor to animate.
481 * @param [in] displacement relative to current position.
482 * @param [in] alpha The alpha function to apply.
484 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha);
487 * @brief Move an actor relative to its position.
489 * This overload allows the translation start & end time to be customized.
490 * @pre delaySeconds must be zero or greater.
491 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
492 * @param [in] actor The actor to animate.
493 * @param [in] displacement relative to current position.
494 * @param [in] alpha The alpha function to apply.
495 * @param [in] delaySeconds The initial delay from the start of the animation.
496 * @param [in] durationSeconds The duration of the translation.
498 void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds);
501 * @brief Move an actor to a target position.
503 * The default alpha function will be used.
504 * The move will start & end when the animation begins & ends.
505 * @param [in] actor The actor to animate.
506 * @param [in] x axis position.
507 * @param [in] y axis position.
508 * @param [in] z axis position.
510 void MoveTo(Actor actor, float x, float y, float z);
513 * @brief Move an actor to a target position.
515 * This overload allows the alpha function to be customized.
516 * The move will start & end when the animation begins & ends.
517 * @param [in] actor The actor to animate.
518 * @param [in] position to move to
519 * @param [in] alpha The alpha function to apply.
521 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha);
524 * @brief Move an actor to a target position.
526 * This overload allows the translation start & end time to be customized.
527 * @pre delaySeconds must be zero or greater.
528 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
529 * @param [in] actor The actor to animate.
530 * @param [in] position to move to
531 * @param [in] alpha The alpha function to apply.
532 * @param [in] delaySeconds The initial delay from the start of the animation.
533 * @param [in] durationSeconds The duration of the translation.
535 void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds);
538 * @brief Rotate an actor around an arbitrary axis.
540 * The default alpha function will be used.
541 * The rotation will start & end when the animation begins & ends.
542 * @param [in] actor The actor to animate.
543 * @param [in] angle The angle in degrees.
544 * @param [in] axis The axis to rotate around
546 void RotateBy(Actor actor, Degree angle, Vector3 axis);
549 * @brief Rotate an actor around an arbitrary axis.
551 * The default alpha function will be used.
552 * The rotation will start & end when the animation begins & ends.
553 * @param [in] actor The actor to animate.
554 * @param [in] angle The angle in radians.
555 * @param [in] axis The axis to rotate around
557 void RotateBy(Actor actor, Radian angle, Vector3 axis);
560 * @brief Rotate an actor around an arbitrary axis.
562 * This overload allows the alpha function to be customized.
563 * The rotation will start & end when the animation begins & ends.
564 * @param [in] actor The actor to animate.
565 * @param [in] angle The angle in radians.
566 * @param [in] axis The axis to rotate around.
567 * @param [in] alpha The alpha function to apply.
569 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
572 * @brief Rotate an actor around an arbitrary axis.
574 * This overload allows the alpha function to be customized.
575 * The rotation will start & end when the animation begins & ends.
576 * @param [in] actor The actor to animate.
577 * @param [in] angle The angle in radians.
578 * @param [in] axis The axis to rotate around.
579 * @param [in] alpha The alpha function to apply.
581 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
584 * @brief Rotate an actor around an arbitrary axis.
586 * This overload allows the rotation start & end time to be customized.
587 * @pre delaySeconds must be zero or greater.
588 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
589 * @param [in] actor The actor to animate.
590 * @param [in] angle The angle in degrees.
591 * @param [in] axis The axis to rotate around
592 * @param [in] alpha The alpha function to apply.
593 * @param [in] delaySeconds The initial delay from the start of the animation.
594 * @param [in] durationSeconds The duration of the rotation.
596 void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
599 * @brief Rotate an actor around an arbitrary axis.
601 * This overload allows the rotation start & end time to be customized.
602 * @pre delaySeconds must be zero or greater.
603 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
604 * @param [in] actor The actor to animate.
605 * @param [in] angle The angle in radians.
606 * @param [in] axis The axis to rotate around
607 * @param [in] alpha The alpha function to apply.
608 * @param [in] delaySeconds The initial delay from the start of the animation.
609 * @param [in] durationSeconds The duration of the rotation.
611 void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
614 * @brief Rotate an actor to a target orientation.
616 * The default alpha function will be used.
617 * The rotation will start & end when the animation begins & ends.
618 * @param [in] actor The actor to animate.
619 * @param [in] angle The target rotation angle in degrees.
620 * @param [in] axis The target axis of rotation.
622 void RotateTo(Actor actor, Degree angle, Vector3 axis);
625 * @brief Rotate an actor to a target orientation.
627 * The default alpha function will be used.
628 * The rotation will start & end when the animation begins & ends.
629 * @param [in] actor The actor to animate.
630 * @param [in] angle The target rotation angle in radians.
631 * @param [in] axis The target axis of rotation.
633 void RotateTo(Actor actor, Radian angle, Vector3 axis);
636 * @brief Rotate an actor to a target orientation.
638 * The default alpha function will be used.
639 * The rotation will start & end when the animation begins & ends.
640 * @param [in] actor The actor to animate.
641 * @param [in] orientation The target orientation.
643 void RotateTo(Actor actor, Quaternion orientation);
646 * @brief Rotate an actor to a target orientation.
648 * This overload allows the alpha function to be customized.
649 * The rotation will start & end when the animation begins & ends.
650 * @param [in] actor The actor to animate.
651 * @param [in] angle The target rotation angle in degrees.
652 * @param [in] axis The target axis of rotation.
653 * @param [in] alpha The alpha function to apply.
655 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
658 * @brief Rotate an actor to a target orientation.
660 * This overload allows the alpha function to be customized.
661 * The rotation will start & end when the animation begins & ends.
662 * @param [in] actor The actor to animate.
663 * @param [in] angle The target rotation angle in radians.
664 * @param [in] axis The target axis of rotation.
665 * @param [in] alpha The alpha function to apply.
667 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
670 * @brief Rotate an actor to a target orientation.
672 * This overload allows the alpha function to be customized.
673 * The rotation will start & end when the animation begins & ends.
674 * @param [in] actor The actor to animate.
675 * @param [in] orientation The target orientation.
676 * @param [in] alpha The alpha function to apply.
678 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha);
681 * @brief Rotate an actor to a target orientation.
683 * This overload allows the rotation start & end time to be customized.
684 * @pre delaySeconds must be zero or greater.
685 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
686 * @param [in] actor The actor to animate.
687 * @param [in] angle The target rotation angle in degrees.
688 * @param [in] axis The target axis of rotation.
689 * @param [in] alpha The alpha function to apply.
690 * @param [in] delaySeconds The initial delay from the start of the animation.
691 * @param [in] durationSeconds The duration of the rotation.
693 void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
696 * @brief Rotate an actor to a target orientation.
698 * This overload allows the rotation start & end time to be customized.
699 * @pre delaySeconds must be zero or greater.
700 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
701 * @param [in] actor The actor to animate.
702 * @param [in] angle The target rotation angle in radians.
703 * @param [in] axis The target axis of rotation.
704 * @param [in] alpha The alpha function to apply.
705 * @param [in] delaySeconds The initial delay from the start of the animation.
706 * @param [in] durationSeconds The duration of the rotation.
708 void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
711 * @brief Rotate an actor to a target orientation.
713 * This overload allows the rotation start & end time to be customized.
714 * @pre delaySeconds must be zero or greater.
715 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
716 * @param [in] actor The actor to animate.
717 * @param [in] orientation The target orientation.
718 * @param [in] alpha The alpha function to apply.
719 * @param [in] delaySeconds The initial delay from the start of the animation.
720 * @param [in] durationSeconds The duration of the rotation.
722 void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
725 * @brief Scale an actor.
727 * The default alpha function will be used.
728 * The scaling will start & end when the animation begins & ends.
729 * @param [in] actor The actor to animate.
730 * @param [in] x Scale factor in the X-direction.
731 * @param [in] y Scale factor in the Y-direction.
732 * @param [in] z Scale factor in the Z-direction.
734 void ScaleBy(Actor actor, float x, float y, float z);
737 * @brief Scale an actor.
739 * This overload allows the alpha function to be customized.
740 * The scaling will start & end when the animation begins & ends.
741 * @param [in] actor The actor to animate.
742 * @param [in] scale The scale factor.
743 * @param [in] alpha The alpha function to apply.
745 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha);
748 * @brief Scale an actor.
750 * This overload allows the scaling start & end time to be customized.
751 * @pre delaySeconds must be zero or greater.
752 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
753 * @param [in] actor The actor to animate.
754 * @param [in] scale The scale factor.
755 * @param [in] alpha The alpha function to apply.
756 * @param [in] delaySeconds The initial delay from the start of the animation.
757 * @param [in] durationSeconds The duration of the scaling.
759 void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
762 * @brief Scale an actor to a target scale factor.
764 * The default alpha function will be used.
765 * The scaling will start & end when the animation begins & ends.
766 * @param [in] actor The actor to animate.
767 * @param [in] x Target scale-factor in the X-direction.
768 * @param [in] y Target scale-factor in the Y-direction.
769 * @param [in] z Target scale-factor in the Z-direction.
771 void ScaleTo(Actor actor, float x, float y, float z);
774 * @brief Scale an actor to a target scale factor.
776 * This overload allows the alpha function to be customized.
777 * The scaling will start & end when the animation begins & ends.
778 * @param [in] actor The actor to animate.
779 * @param [in] scale The target scale factor.
780 * @param [in] alpha The alpha function to apply.
782 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha);
785 * @brief Scale an actor to a target scale factor.
787 * This overload allows the scaling start & end time to be customized.
788 * @pre delaySeconds must be zero or greater.
789 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
790 * @param [in] actor The actor to animate.
791 * @param [in] scale The target scale factor.
792 * @param [in] alpha The alpha function to apply.
793 * @param [in] delaySeconds The initial delay from the start of the animation.
794 * @param [in] durationSeconds The duration of the scaling.
796 void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
799 * @brief Show an actor during the animation.
801 * @param [in] actor The actor to animate.
802 * @param [in] delaySeconds The initial delay from the start of the animation.
804 void Show(Actor actor, float delaySeconds);
807 * @brief Hide an actor during the animation.
809 * @param [in] actor The actor to animate.
810 * @param [in] delaySeconds The initial delay from the start of the animation.
812 void Hide(Actor actor, float delaySeconds);
815 * @brief Animate the opacity of an actor.
817 * The default alpha function will be used.
818 * The effect will start & end when the animation begins & ends.
819 * @param [in] actor The actor to animate.
820 * @param [in] opacity The relative change in opacity.
822 void OpacityBy(Actor actor, float opacity);
825 * @brief Animate the opacity of an actor.
827 * This overload allows the alpha function to be customized.
828 * The effect will start & end when the animation begins & ends.
829 * @param [in] actor The actor to animate.
830 * @param [in] opacity The relative change in opacity.
831 * @param [in] alpha The alpha function to apply.
833 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha);
836 * @brief Animate the opacity of an actor.
838 * This overload allows the animation start & end time to be customized.
839 * @pre delaySeconds must be zero or greater.
840 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
841 * @param [in] actor The actor to animate.
842 * @param [in] opacity The relative change in opacity.
843 * @param [in] alpha The alpha function to apply.
844 * @param [in] delaySeconds The initial delay from the start of the animation.
845 * @param [in] durationSeconds The duration of the opacity animation.
847 void OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
850 * @brief Animate an actor to a target opacity.
852 * The default alpha function will be used.
853 * The effect will start & end when the animation begins & ends.
854 * @param [in] actor The actor to animate.
855 * @param [in] opacity The target opacity.
857 void OpacityTo(Actor actor, float opacity);
860 * @brief Animate an actor to a target opacity.
862 * This overload allows the alpha function to be customized.
863 * The effect will start & end when the animation begins & ends.
864 * @param [in] actor The actor to animate.
865 * @param [in] opacity The target opacity.
866 * @param [in] alpha The alpha function to apply.
868 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha);
871 * @brief Animate an actor to a target opacity.
873 * This overload allows the animation start & end time to be customized.
874 * @pre delaySeconds must be zero or greater.
875 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
876 * @param [in] actor The actor to animate.
877 * @param [in] opacity The target opacity.
878 * @param [in] alpha The alpha function to apply.
879 * @param [in] delaySeconds The initial delay from the start of the animation.
880 * @param [in] durationSeconds The duration of the opacity animation.
882 void OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
885 * @brief Animate the color of an actor.
887 * The default alpha function will be used.
888 * The effect will start & end when the animation begins & ends.
889 * @param [in] actor The actor to animate.
890 * @param [in] color The relative change in color.
892 void ColorBy(Actor actor, Vector4 color);
895 * @brief Animate the color of an actor.
897 * This overload allows the alpha function to be customized.
898 * The effect will start & end when the animation begins & ends.
899 * @param [in] actor The actor to animate.
900 * @param [in] color The relative change in color.
901 * @param [in] alpha The alpha function to apply.
903 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha);
906 * @brief Animate the color of an actor.
908 * This overload allows the animation start & end time to be customized.
909 * @pre delaySeconds must be zero or greater.
910 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
911 * @param [in] actor The actor to animate.
912 * @param [in] color The relative change in color.
913 * @param [in] alpha The alpha function to apply.
914 * @param [in] delaySeconds The initial delay from the start of the animation.
915 * @param [in] durationSeconds The duration of the color animation.
917 void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
920 * @brief Animate an actor to a target color.
922 * The default alpha function will be used.
923 * The effect will start & end when the animation begins & ends.
924 * @param [in] actor The actor to animate.
925 * @param [in] color The target color.
927 void ColorTo(Actor actor, Vector4 color);
930 * @brief Animate an actor to a target color.
932 * This overload allows the alpha function to be customized.
933 * The effect will start & end when the animation begins & ends.
934 * @param [in] actor The actor to animate.
935 * @param [in] color The target color.
936 * @param [in] alpha The alpha function to apply.
938 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha);
941 * @brief Animate an actor to a target color.
943 * This overload allows the animation start & end time to be customized.
944 * @pre delaySeconds must be zero or greater.
945 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
946 * @param [in] actor The actor to animate.
947 * @param [in] color The target color.
948 * @param [in] alpha The alpha function to apply.
949 * @param [in] delaySeconds The initial delay from the start of the animation.
950 * @param [in] durationSeconds The duration of the color animation.
952 void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
955 * @brief Resize an actor.
957 * The default alpha function will be used.
958 * The resizing will start & end when the animation begins & ends.
959 * The depth defaults to the minimum of width & height.
960 * @param [in] actor The actor to animate.
961 * @param [in] width The target width.
962 * @param [in] height The target height.
964 void Resize(Actor actor, float width, float height);
967 * @brief Resize an actor.
969 * This overload allows the alpha function to be customized.
970 * The resizing will start & end when the animation begins & ends.
971 * The depth defaults to the minimum of width & height.
972 * @param [in] actor The actor to animate.
973 * @param [in] width The target width.
974 * @param [in] height The target height.
975 * @param [in] alpha The alpha function to apply.
977 void Resize(Actor actor, float width, float height, AlphaFunction alpha);
980 * @brief Resize an actor.
982 * This overload allows the resizing start & end time to be customized.
983 * The depth defaults to the minimum of width & height.
984 * @pre delaySeconds must be zero or greater.
985 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
986 * @param [in] actor The actor to animate.
987 * @param [in] width The target width.
988 * @param [in] height The target height.
989 * @param [in] alpha The alpha function to apply.
990 * @param [in] delaySeconds The initial delay from the start of the animation.
991 * @param [in] durationSeconds The duration of the resizing.
993 void Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
996 * @brief Resize an actor.
998 * The default alpha function will be used.
999 * The resizing will start & end when the animation begins & ends.
1000 * @param [in] actor The actor to animate.
1001 * @param [in] size The target size.
1003 void Resize(Actor actor, Vector3 size);
1006 * @brief Resize an actor.
1008 * This overload allows the alpha function to be customized.
1009 * The resizing will start & end when the animation begins & ends.
1010 * @param [in] actor The actor to animate.
1011 * @param [in] size The target size.
1012 * @param [in] alpha The alpha function to apply.
1014 void Resize(Actor actor, Vector3 size, AlphaFunction alpha);
1017 * @brief Resize an actor.
1019 * This overload allows the resizing start & end time to be customized.
1020 * @pre delaySeconds must be zero or greater.
1021 * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
1022 * @param [in] actor The actor to animate.
1023 * @param [in] size The target size.
1024 * @param [in] alpha The alpha function to apply.
1025 * @param [in] delaySeconds The initial delay from the start of the animation.
1026 * @param [in] durationSeconds The duration of the resizing.
1028 void Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
1030 public: // Not intended for use by Application developers
1033 * @brief This constructor is used by Dali New() methods
1034 * @param [in] animation A pointer to a newly allocated Dali resource
1036 explicit DALI_INTERNAL Animation(Internal::Animation* animation);
1042 #endif // __DALI_ANIMATION_H__