1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 // Some have been manually changed
23 using System.Runtime.InteropServices;
26 /// Animation can be used to animate the properties of any number of objects, typically Actors.
27 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.
28 /// This is typically done in the object destructor, and requires either the Animation handle to be stored.
29 /// The overall animation time is superseded by the values given in the Duration property used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.
30 /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.
32 public class Animation : BaseHandle
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn)
38 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 DisposeQueue.Instance.Add(this);
52 /// To make Animation instance be disposed.
54 public override void Dispose()
56 if (!Stage.IsInstalled())
58 DisposeQueue.Instance.Add(this);
64 if (swigCPtr.Handle != global::System.IntPtr.Zero)
69 NDalicPINVOKE.delete_Animation(swigCPtr);
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 global::System.GC.SuppressFinalize(this);
79 /// Create an initialized Animation.
80 /// The animation will not loop.
81 /// The default end action is "Cancel".
82 /// The default Alpha function is linear.
83 /// Precodition : DurationmSeconds must be greater than zero.
85 /// <param name="durationMilliSeconds">The duration in milli seconds (int).</param>
86 public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true)
88 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91 private AnimationFinishedEventCallbackType _animationFinishedEventCallback;
92 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
93 private delegate void AnimationFinishedEventCallbackType(IntPtr data);
94 private event EventHandler _animationFinishedEventHandler;
96 * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler
97 * Finished signal is emitted when an Animation's animations have finished.
99 public event EventHandler Finished
103 if (_animationFinishedEventHandler == null)
105 _animationFinishedEventCallback = OnFinished;
106 FinishedSignal().Connect(_animationFinishedEventCallback);
109 _animationFinishedEventHandler += value;
113 _animationFinishedEventHandler -= value;
115 if (_animationFinishedEventHandler == null && _animationFinishedEventCallback != null)
117 FinishedSignal().Disconnect(_animationFinishedEventCallback);
121 private void OnFinished(IntPtr data)
123 if (_animationFinishedEventHandler != null)
125 //here we send all data to user event handlers
126 _animationFinishedEventHandler(this, null);
131 public static Animation GetAnimationFromPtr(global::System.IntPtr cPtr)
133 Animation ret = new Animation(cPtr, false);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 private float MilliSecondsToSeconds(int millisec)
140 return (float)millisec / 1000.0f;
143 private int SecondsToMilliSeconds(float sec)
145 return (int)(sec * 1000);
150 /// Gets/Sets the duration of animation
156 SetDuration(MilliSecondsToSeconds(value));
160 return SecondsToMilliSeconds(GetDuration());
165 /// Gets/Sets the default alpha function for an animation.
167 public AlphaFunction DefaultAlphaFunction
171 SetDefaultAlphaFunction(value);
175 AlphaFunction ret = GetDefaultAlphaFunction();
181 /// Queries the state of the animation.
192 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.
193 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.
194 /// Setting this parameter does not cause the animation to Play().
196 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.
197 /// The loop count is initially 1 for play once.
207 int ret = GetLoopCount();
213 /// Gets/Sets the status of whether the animation will loop.
214 /// This property resets the loop count and should not be used with LoopCount property.
215 /// Setting this parameter does not cause the animation to Play().
225 bool ret = IsLooping();
232 /// Gets/Sets the end action of the animation.
233 /// This action is performed when the animation ends or if it is stopped.
234 /// Default end action is Cancel
236 public EndActions EndAction
244 return GetEndAction();
250 /// Stops the animation.
252 /// <param name="action">end action can be set</param>
253 public void Stop(EndActions action = EndActions.Cancel)
255 SetEndAction(action);
256 NDalicPINVOKE.Animation_Stop(swigCPtr);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 /// Gets the current loop count.
262 /// A value 0 to CurrentLoop indicating the current loop count when looping.
264 public int CurrentLoop
268 return GetCurrentLoop();
273 /// Gets/Sets the disconnect action.
274 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
275 /// Default action is to Cancel.
277 public EndActions DisconnectAction
281 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
287 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
294 /// Gets/Sets the progress of the animation.
295 /// The animation will play(or continue playing) from this point.
296 /// The progress must be in the 0-1 interval or in the play range interval if defined
297 /// otherwise, it will be ignored.
299 public float CurrentProgress
303 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
304 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
308 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
315 /// Gets/Sets Specifies a speed factor for the animation.
316 /// The speed factor is a multiplier of the normal velocity of the animation.
317 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.
318 /// It is also possible to specify a negative multiplier to play the animation in reverse.
320 public float SpeedFactor
324 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
325 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
329 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 /// Gets/Sets the playing range.
337 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
338 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.
340 public Vector2 PlayRange
344 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
350 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 /// Animates a property value by a relative amount.
357 /// The default alpha function will be used.
358 /// The effect will start & end when the animation begins & ends.
360 /// <param name="target">The target object to animate</param>
361 /// <param name="property">The target property to animate</param>
362 /// <param name="relativeValue">The property value will change by this amount</param>
363 /// <param name="alphaFunction">The alpha function to apply</param>
364 public void AnimateBy(Actor target, string property, object relativeValue, AlphaFunction alphaFunction = null)
366 string _str1 = property.Substring(0, 1);
367 string _str2 = property.Substring(1);
368 string _str = _str1.ToLower() + _str2;
370 Property _prop = new Property(target, _str);
371 if (_prop.propertyIndex == Property.INVALID_INDEX)
373 throw new System.Exception("second argument string property is invalid parameter!");
376 dynamic obj = (object)relativeValue;
378 if (alphaFunction != null)
380 AnimateBy(_prop, new PropertyValue(obj), alphaFunction);
384 AnimateBy(_prop, new PropertyValue(obj));
389 /// Animates a property value by a relative amount.
390 /// The default alpha function will be used.
391 /// The effect will start & end when the animation begins & ends.
393 /// <param name="target">The target object to animate</param>
394 /// <param name="property">The target property to animate</param>
395 /// <param name="relativeValue">The property value will change by this amount</param>
396 /// <param name="startTime">Start time of animation</param>
397 /// <param name="endTime">End time of animation</param>
398 /// <param name="alphaFunction">The alpha function to apply</param>
399 public void AnimateBy(Actor target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
401 string _str1 = property.Substring(0, 1);
402 string _str2 = property.Substring(1);
403 string _str = _str1.ToLower() + _str2;
405 Property _prop = new Property(target, _str);
406 if (_prop.propertyIndex == Property.INVALID_INDEX)
408 throw new System.Exception("second argument string property is invalid parameter!");
411 dynamic obj = (object)relativeValue;
413 if (alphaFunction != null)
415 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
416 AnimateBy(_prop, new PropertyValue(obj), alphaFunction, time);
420 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
421 AnimateBy(_prop, new PropertyValue(obj), time);
426 /// Animates a property to a destination value.
427 /// The default alpha function will be used.
428 /// The effect will start & end when the animation begins & ends.
430 /// <param name="target">The target object to animate</param>
431 /// <param name="property">The target property to animate</param>
432 /// <param name="destinationValue">The destination value</param>
433 /// <param name="alphaFunction">The alpha function to apply</param>
434 public void AnimateTo(Actor target, string property, object destinationValue, AlphaFunction alphaFunction = null)
436 string _str1 = property.Substring(0, 1);
437 string _str2 = property.Substring(1);
438 string _str = _str1.ToLower() + _str2;
440 Property _prop = new Property(target, _str);
441 if (_prop.propertyIndex == Property.INVALID_INDEX)
443 throw new System.Exception("second argument string property is invalid parameter!");
446 dynamic obj = (object)destinationValue;
448 if (alphaFunction != null)
450 AnimateTo(_prop, new PropertyValue(obj), alphaFunction);
454 AnimateTo(_prop, new PropertyValue(obj));
459 /// Animates a property to a destination value.
460 /// The default alpha function will be used.
461 /// The effect will start & end when the animation begins & ends.
463 /// <param name="target">The target object to animate</param>
464 /// <param name="property">The target property to animate</param>
465 /// <param name="destinationValue">The destination value</param>
466 /// <param name="alphaFunction">The alpha function to apply</param>
467 /// <param name="startTime">Start time of animation</param>
468 /// <param name="endTime">End time of animation</param>
469 /// <param name="alphaFunction"></param>
470 public void AnimateTo(Actor target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
472 string _str1 = property.Substring(0, 1);
473 string _str2 = property.Substring(1);
474 string _str = _str1.ToLower() + _str2;
476 Property _prop = new Property(target, _str);
477 if (_prop.propertyIndex == Property.INVALID_INDEX)
479 throw new System.Exception("second argument string property is invalid parameter!");
482 dynamic obj = (object)destinationValue;
484 if (alphaFunction != null)
486 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
487 AnimateTo(_prop, new PropertyValue(obj), alphaFunction, time);
491 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
492 AnimateTo(_prop, new PropertyValue(obj), time);
497 /// Animates a property between keyframes.
499 /// <param name="target">The target object to animate</param>
500 /// <param name="property">The target property to animate</param>
501 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
502 /// <param name="interpolation">The method used to interpolate between values</param>
503 /// <param name="alphaFunction">The alpha function to apply</param>
504 public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
506 string _str1 = property.Substring(0, 1);
507 string _str2 = property.Substring(1);
508 string _str = _str1.ToLower() + _str2;
510 Property _prop = new Property(target, _str);
511 if (_prop.propertyIndex == Property.INVALID_INDEX)
513 throw new System.Exception("second argument string property is invalid parameter!");
516 if (alphaFunction != null)
518 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
522 AnimateBetween(_prop, keyFrames, interpolation);
528 /// Animates a property between keyframes.
530 /// <param name="target">The target object to animate</param>
531 /// <param name="property">The target property to animate</param>
532 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
533 /// <param name="startTime">Start time of animation</param>
534 /// <param name="endTime">End time of animation</param>
535 /// <param name="interpolation">The method used to interpolate between values</param>
536 /// <param name="alphaFunction">The alpha function to apply</param>
537 public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
539 string _str1 = property.Substring(0, 1);
540 string _str2 = property.Substring(1);
541 string _str = _str1.ToLower() + _str2;
543 Property _prop = new Property(target, _str);
544 if (_prop.propertyIndex == Property.INVALID_INDEX)
546 throw new System.Exception("second argument string property is invalid parameter!");
549 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
550 if (alphaFunction != null)
552 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
556 AnimateBetween(_prop, keyFrames, time, interpolation);
561 /// Animates an actor's position and orientation through a predefined path.
562 /// The actor will rotate to orient the supplied forward vector with the path's tangent.
563 /// If forward is the zero vector then no rotation will happen.
565 /// <param name="actor">The actor to animate</param>
566 /// <param name="path">It defines position and orientation</param>
567 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
568 /// <param name="alphaFunction">The alpha function to apply</param>
569 public void AnimatePath(Actor actor, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
571 if (alphaFunction == null)
573 Animate(actor, path, forward);
577 Animate(actor, path, forward, alphaFunction);
582 /// Animates an actor's position and orientation through a predefined path.
583 /// The actor will rotate to orient the supplied forward vector with the path's tangent.
584 /// If forward is the zero vector then no rotation will happen.
586 /// <param name="actor">The actor to animate</param>
587 /// <param name="path">It defines position and orientation</param>
588 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
589 /// <param name="startTime">Start time of animation</param>
590 /// <param name="endTime">End time of animation</param>
591 /// <param name="alphaFunction">The alpha function to apply</param>
592 public void AnimatePath(Actor actor, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
594 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
595 if (alphaFunction == null)
597 Animate(actor, path, forward, time);
601 Animate(actor, path, forward, alphaFunction, time);
606 /// Creates an initialized Animation.
607 /// The animation will not loop.
608 /// The default end action is "Cancel".
609 /// The default alpha function is linear.
611 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
613 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
616 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
618 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 /// Downcasts a handle to Animation handle.
624 /// If handle points to an Animation object, the downcast produces valid handle.
625 /// If not, the returned handle is left uninitialized.
627 /// <param name="handle">Handle to an object</param>
628 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
629 public static Animation DownCast(BaseHandle handle)
631 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
632 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
636 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
638 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641 internal Animation Assign(Animation rhs)
643 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
644 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648 internal void SetDuration(float seconds)
650 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 internal float GetDuration()
656 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 internal void SetLooping(bool looping)
663 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 internal void SetLoopCount(int count)
669 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
670 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673 internal int GetLoopCount()
675 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 internal int GetCurrentLoop()
682 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
687 internal bool IsLooping()
689 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
694 internal void SetEndAction(Animation.EndActions action)
696 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
700 internal Animation.EndActions GetEndAction()
702 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
703 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
709 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
710 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
713 internal Animation.EndActions GetDisconnectAction()
715 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
716 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
720 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
722 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
723 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
726 internal AlphaFunction GetDefaultAlphaFunction()
728 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
729 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 internal void SetCurrentProgress(float progress)
735 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
739 internal float GetCurrentProgress()
741 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
742 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 internal void SetSpeedFactor(float factor)
748 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
749 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752 internal float GetSpeedFactor()
754 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
755 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759 internal void SetPlayRange(Vector2 range)
761 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
762 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
765 internal Vector2 GetPlayRange()
767 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
768 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
773 /// Play the animation.
777 NDalicPINVOKE.Animation_Play(swigCPtr);
778 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782 /// Plays the animation from a given point.
783 /// The progress must be in the 0-1 interval or in the play range interval if defined
784 /// otherwise, it will be ignored.
786 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
787 public void PlayFrom(float progress)
789 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
790 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
794 /// Pauses the animation.
798 NDalicPINVOKE.Animation_Pause(swigCPtr);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
802 internal Animation.States GetState()
804 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
805 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
810 /// Stops the animation.
814 NDalicPINVOKE.Animation_Stop(swigCPtr);
815 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819 /// Clears the animation.
820 /// This disconnects any objects that were being animated, effectively stopping the animation.
824 NDalicPINVOKE.Animation_Clear(swigCPtr);
825 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
828 internal AnimationSignal FinishedSignal()
830 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
831 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835 internal void AnimateBy(Property target, PropertyValue relativeValue)
837 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
838 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
841 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
843 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
844 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
849 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
850 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
853 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
855 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal void AnimateTo(Property target, PropertyValue destinationValue)
861 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
862 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
865 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
867 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
868 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
871 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
873 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
874 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
877 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
879 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
880 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
883 internal void AnimateBetween(Property target, KeyFrames keyFrames)
885 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
886 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
889 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
891 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
892 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
895 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
897 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
898 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
901 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
903 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
904 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
907 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
909 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
910 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
913 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
915 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
916 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
919 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
921 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
922 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
925 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
927 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
928 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
931 internal void Animate(Actor actor, Path path, Vector3 forward)
933 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward));
934 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
937 internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha)
939 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
940 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
943 internal void Animate(Actor actor, Path path, Vector3 forward, TimePeriod period)
945 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
946 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
949 internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
951 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
952 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
955 internal void Show(Actor actor, float delaySeconds)
957 NDalicPINVOKE.Animation_Show(swigCPtr, Actor.getCPtr(actor), delaySeconds);
958 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
961 internal void Hide(Actor actor, float delaySeconds)
963 NDalicPINVOKE.Animation_Hide(swigCPtr, Actor.getCPtr(actor), delaySeconds);
964 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
968 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
969 /// Cancel : When the animation ends, the animated property values are saved.
970 /// Discard : When the animation ends, the animated property values are forgotten.
971 /// StopFinal : If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
973 public enum EndActions
981 /// Enumeration for what interpolation method to use on key-frame animations.
982 /// Linear : Values in between key frames are interpolated using a linear polynomial. (Default)
983 /// Cubic : Values in between key frames are interpolated using a cubic polynomial.
985 public enum Interpolation
992 /// Enumeration for what state the animation is in.
993 /// Note: Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.