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.<br>
27 /// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.<br>
28 /// This is typically done in the object destructor, and requires either the Animation handle to be stored.<br>
29 /// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.<br>
30 /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.<br>
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.<br>
80 /// The animation will not loop.<br>
81 /// The default end action is "Cancel".<br>
82 /// The default Alpha function is linear.<br>
84 /// <remarks>DurationmSeconds must be greater than zero.</remarks>
85 /// <param name="durationMilliSeconds">The duration in milli seconds.</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)
106 Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty());
107 Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
109 _animationFinishedEventCallback = OnFinished;
110 FinishedSignal().Connect(_animationFinishedEventCallback);
112 Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty());
113 Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
117 _animationFinishedEventHandler += value;
121 _animationFinishedEventHandler -= value;
123 if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false)
126 Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty());
127 Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
129 FinishedSignal().Disconnect(_animationFinishedEventCallback);
131 Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty());
132 Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount());
137 private void OnFinished(IntPtr data)
139 if (_animationFinishedEventHandler != null)
141 //here we send all data to user event handlers
142 _animationFinishedEventHandler(this, null);
147 internal static Animation GetAnimationFromPtr(global::System.IntPtr cPtr)
149 Animation ret = new Animation(cPtr, false);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 private float MilliSecondsToSeconds(int millisec)
156 return (float)millisec / 1000.0f;
159 private int SecondsToMilliSeconds(float sec)
161 return (int)(sec * 1000);
166 /// Gets/Sets the duration in milli seconds of the animation.
172 SetDuration(MilliSecondsToSeconds(value));
176 return SecondsToMilliSeconds(GetDuration());
181 /// Gets/Sets the default alpha function for the animation.
183 public AlphaFunction DefaultAlphaFunction
187 SetDefaultAlphaFunction(value);
191 AlphaFunction ret = GetDefaultAlphaFunction();
197 /// Queries the state of the animation.
208 /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.<br>
209 /// If Play() Stop() or 'count' loops is reached, the loop counter will reset.<br>
210 /// Setting this parameter does not cause the animation to Play().<br>
211 /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.<br>
212 /// The loop count is initially 1 for play once.<br>
222 int ret = GetLoopCount();
228 /// Gets/Sets the status of whether the animation will loop.<br>
229 /// This property resets the loop count and should not be used with LoopCount property.<br>
230 /// Setting this parameter does not cause the animation to Play().<br>
240 bool ret = IsLooping();
247 /// Gets/Sets the end action of the animation.<br>
248 /// This action is performed when the animation ends or if it is stopped.<br>
249 /// Default end action is Cancel.<br>
251 public EndActions EndAction
259 return GetEndAction();
265 /// Stops the animation.
267 /// <param name="action">end action can be set</param>
268 public void Stop(EndActions action = EndActions.Cancel)
270 SetEndAction(action);
271 NDalicPINVOKE.Animation_Stop(swigCPtr);
272 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 /// Gets the current loop count.<br>
277 /// A value 0 indicating the current loop count when looping.<br>
279 public int CurrentLoop
283 return GetCurrentLoop();
288 /// Gets/Sets the disconnect action.<br>
289 /// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.<br>
290 /// Default action is to Cancel.<br>
292 public EndActions DisconnectAction
296 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)value);
297 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
301 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
302 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 /// Gets/Sets the progress of the animation.<br>
310 /// The animation will play(or continue playing) from this point.<br>
311 /// The progress must be in the 0-1 interval or in the play range interval if defined.<br>
312 /// otherwise, it will be ignored.<br>
314 public float CurrentProgress
318 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, value);
319 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
323 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 /// Gets/Sets Specifies a speed factor for the animation.<br>
331 /// The speed factor is a multiplier of the normal velocity of the animation.<br>
332 /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.<br>
333 /// It is also possible to specify a negative multiplier to play the animation in reverse.<br>
335 public float SpeedFactor
339 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, value);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
351 /// Gets/Sets the playing range.<br>
352 /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1,
353 /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.<br>
355 public RelativeVector2 PlayRange
359 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(value));
360 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
364 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
365 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 /// Animates a property value by a relative amount.<br>
373 /// <param name="target">The target object to animate</param>
374 /// <param name="property">The target property to animate</param>
375 /// <param name="relativeValue">The property value will change by this amount</param>
376 /// <param name="alphaFunction">The alpha function to apply</param>
377 public void AnimateBy(Actor target, string property, object relativeValue, AlphaFunction alphaFunction = null)
379 string _str1 = property.Substring(0, 1);
380 string _str2 = property.Substring(1);
381 string _str = _str1.ToLower() + _str2;
383 Property _prop = new Property(target, _str);
384 if (_prop.propertyIndex == Property.INVALID_INDEX)
386 throw new System.Exception("second argument string property is invalid parameter!");
389 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
391 if (alphaFunction != null)
393 AnimateBy(_prop, val, alphaFunction);
397 AnimateBy(_prop, val);
402 /// Animates a property value by a relative amount.<br>
404 /// <param name="target">The target object to animate</param>
405 /// <param name="property">The target property to animate</param>
406 /// <param name="relativeValue">The property value will change by this amount</param>
407 /// <param name="startTime">Start time of animation</param>
408 /// <param name="endTime">End time of animation</param>
409 /// <param name="alphaFunction">The alpha function to apply</param>
410 public void AnimateBy(Actor target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
412 string _str1 = property.Substring(0, 1);
413 string _str2 = property.Substring(1);
414 string _str = _str1.ToLower() + _str2;
416 Property _prop = new Property(target, _str);
417 if (_prop.propertyIndex == Property.INVALID_INDEX)
419 throw new System.Exception("second argument string property is invalid parameter!");
422 PropertyValue val = PropertyValue.CreateFromObject(relativeValue);
424 if (alphaFunction != null)
426 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
427 AnimateBy(_prop, val, alphaFunction, time);
431 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
432 AnimateBy(_prop, val, time);
437 /// Animates a property to a destination value.<br>
439 /// <param name="target">The target object to animate</param>
440 /// <param name="property">The target property to animate</param>
441 /// <param name="destinationValue">The destination value</param>
442 /// <param name="alphaFunction">The alpha function to apply</param>
443 public void AnimateTo(Actor target, string property, object destinationValue, AlphaFunction alphaFunction = null)
445 string _str1 = property.Substring(0, 1);
446 string _str2 = property.Substring(1);
447 string _str = _str1.ToLower() + _str2;
449 Property _prop = new Property(target, _str);
450 if (_prop.propertyIndex == Property.INVALID_INDEX)
452 throw new System.Exception("second argument string property is invalid parameter!");
455 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
457 if (alphaFunction != null)
459 AnimateTo(_prop, val, alphaFunction);
463 AnimateTo(_prop, val);
468 /// Animates a property to a destination value.<br>
470 /// <param name="target">The target object to animate</param>
471 /// <param name="property">The target property to animate</param>
472 /// <param name="destinationValue">The destination value</param>
473 /// <param name="alphaFunction">The alpha function to apply</param>
474 /// <param name="startTime">Start time of animation</param>
475 /// <param name="endTime">End time of animation</param>
476 /// <param name="alphaFunction">The alpha function to apply</param>
477 public void AnimateTo(Actor target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null)
479 string _str1 = property.Substring(0, 1);
480 string _str2 = property.Substring(1);
481 string _str = _str1.ToLower() + _str2;
483 Property _prop = new Property(target, _str);
484 if (_prop.propertyIndex == Property.INVALID_INDEX)
486 throw new System.Exception("second argument string property is invalid parameter!");
489 PropertyValue val = PropertyValue.CreateFromObject(destinationValue);
491 if (alphaFunction != null)
493 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
494 AnimateTo(_prop, val, alphaFunction, time);
498 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
499 AnimateTo(_prop, val, time);
504 /// Animates a property between keyframes.
506 /// <param name="target">The target object to animate</param>
507 /// <param name="property">The target property to animate</param>
508 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
509 /// <param name="interpolation">The method used to interpolate between values</param>
510 /// <param name="alphaFunction">The alpha function to apply</param>
511 public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
513 string _str1 = property.Substring(0, 1);
514 string _str2 = property.Substring(1);
515 string _str = _str1.ToLower() + _str2;
517 Property _prop = new Property(target, _str);
518 if (_prop.propertyIndex == Property.INVALID_INDEX)
520 throw new System.Exception("second argument string property is invalid parameter!");
523 if (alphaFunction != null)
525 AnimateBetween(_prop, keyFrames, alphaFunction, interpolation);
529 AnimateBetween(_prop, keyFrames, interpolation);
535 /// Animates a property between keyframes.
537 /// <param name="target">The target object to animate</param>
538 /// <param name="property">The target property to animate</param>
539 /// <param name="keyFrames">The set of time/value pairs between which to animate</param>
540 /// <param name="startTime">Start time of animation in milli seconds</param>
541 /// <param name="endTime">End time of animation in milli seconds</param>
542 /// <param name="interpolation">The method used to interpolate between values</param>
543 /// <param name="alphaFunction">The alpha function to apply</param>
544 public void AnimateBetween(Actor target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null)
546 string _str1 = property.Substring(0, 1);
547 string _str2 = property.Substring(1);
548 string _str = _str1.ToLower() + _str2;
550 Property _prop = new Property(target, _str);
551 if (_prop.propertyIndex == Property.INVALID_INDEX)
553 throw new System.Exception("second argument string property is invalid parameter!");
556 Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
557 if (alphaFunction != null)
559 AnimateBetween(_prop, keyFrames, alphaFunction, time, interpolation);
563 AnimateBetween(_prop, keyFrames, time, interpolation);
568 /// Animates an actor's position and orientation through a predefined path.<br>
569 /// The actor will rotate to orient the supplied forward vector with the path's tangent.<br>
570 /// If forward is the zero vector then no rotation will happen.<br>
572 /// <param name="actor">The actor to animate</param>
573 /// <param name="path">It defines position and orientation</param>
574 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
575 /// <param name="alphaFunction">The alpha function to apply</param>
576 public void AnimatePath(Actor actor, Path path, Vector3 forward, AlphaFunction alphaFunction = null)
578 if (alphaFunction == null)
580 Animate(actor, path, forward);
584 Animate(actor, path, forward, alphaFunction);
589 /// Animates an actor's position and orientation through a predefined path.<br>
590 /// The actor will rotate to orient the supplied forward vector with the path's tangent.<br>
591 /// If forward is the zero vector then no rotation will happen.<br>
593 /// <param name="actor">The actor to animate</param>
594 /// <param name="path">It defines position and orientation</param>
595 /// <param name="forward">The vector (in local space coordinate system) that will be oriented with the path's tangent direction</param>
596 /// <param name="startTime">Start time of animation</param>
597 /// <param name="endTime">End time of animation</param>
598 /// <param name="alphaFunction">The alpha function to apply</param>
599 public void AnimatePath(Actor actor, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null)
601 TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime));
602 if (alphaFunction == null)
604 Animate(actor, path, forward, time);
608 Animate(actor, path, forward, alphaFunction, time);
613 /// Creates an initialized Animation.<br>
614 /// The animation will not loop.<br>
615 /// The default end action is "Cancel".<br>
616 /// The default alpha function is linear.<br>
618 public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true)
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
623 internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true)
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
630 /// Downcasts a handle to Animation handle.<br>
631 /// If handle points to an Animation object, the downcast produces valid handle.<br>
632 /// If not, the returned handle is left uninitialized.<br>
634 /// <param name="handle">Handle to an object</param>
635 /// <returns>Handle to an Animation object or an uninitialized handle</returns>
636 public static Animation DownCast(BaseHandle handle)
638 Animation ret = new Animation(NDalicPINVOKE.Animation_DownCast(BaseHandle.getCPtr(handle)), true);
639 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
643 internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true)
645 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648 internal Animation Assign(Animation rhs)
650 Animation ret = new Animation(NDalicPINVOKE.Animation_Assign(swigCPtr, Animation.getCPtr(rhs)), false);
651 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
655 internal void SetDuration(float seconds)
657 NDalicPINVOKE.Animation_SetDuration(swigCPtr, seconds);
658 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 internal float GetDuration()
663 float ret = NDalicPINVOKE.Animation_GetDuration(swigCPtr);
664 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
668 internal void SetLooping(bool looping)
670 NDalicPINVOKE.Animation_SetLooping(swigCPtr, looping);
671 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674 internal void SetLoopCount(int count)
676 NDalicPINVOKE.Animation_SetLoopCount(swigCPtr, count);
677 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 internal int GetLoopCount()
682 int ret = NDalicPINVOKE.Animation_GetLoopCount(swigCPtr);
683 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
687 internal int GetCurrentLoop()
689 int ret = NDalicPINVOKE.Animation_GetCurrentLoop(swigCPtr);
690 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
694 internal bool IsLooping()
696 bool ret = NDalicPINVOKE.Animation_IsLooping(swigCPtr);
697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
701 internal void SetEndAction(Animation.EndActions action)
703 NDalicPINVOKE.Animation_SetEndAction(swigCPtr, (int)action);
704 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
707 internal Animation.EndActions GetEndAction()
709 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetEndAction(swigCPtr);
710 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
714 internal void SetDisconnectAction(Animation.EndActions disconnectAction)
716 NDalicPINVOKE.Animation_SetDisconnectAction(swigCPtr, (int)disconnectAction);
717 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
720 internal Animation.EndActions GetDisconnectAction()
722 Animation.EndActions ret = (Animation.EndActions)NDalicPINVOKE.Animation_GetDisconnectAction(swigCPtr);
723 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
727 internal void SetDefaultAlphaFunction(AlphaFunction alpha)
729 NDalicPINVOKE.Animation_SetDefaultAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha));
730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 internal AlphaFunction GetDefaultAlphaFunction()
735 AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.Animation_GetDefaultAlphaFunction(swigCPtr), true);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
740 internal void SetCurrentProgress(float progress)
742 NDalicPINVOKE.Animation_SetCurrentProgress(swigCPtr, progress);
743 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 internal float GetCurrentProgress()
748 float ret = NDalicPINVOKE.Animation_GetCurrentProgress(swigCPtr);
749 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
753 internal void SetSpeedFactor(float factor)
755 NDalicPINVOKE.Animation_SetSpeedFactor(swigCPtr, factor);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
759 internal float GetSpeedFactor()
761 float ret = NDalicPINVOKE.Animation_GetSpeedFactor(swigCPtr);
762 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
766 internal void SetPlayRange(Vector2 range)
768 NDalicPINVOKE.Animation_SetPlayRange(swigCPtr, Vector2.getCPtr(range));
769 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
772 internal Vector2 GetPlayRange()
774 Vector2 ret = new Vector2(NDalicPINVOKE.Animation_GetPlayRange(swigCPtr), true);
775 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
780 /// Plays the animation.
784 NDalicPINVOKE.Animation_Play(swigCPtr);
785 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
789 /// Plays the animation from a given point.<br>
790 /// The progress must be in the 0-1 interval or in the play range interval if defined,
791 /// otherwise, it will be ignored.<br>
793 /// <param name="progress">A value between [0,1], or between the play range if specified, from where the animation should start playing</param>
794 public void PlayFrom(float progress)
796 NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress);
797 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
801 /// Pauses the animation.
805 NDalicPINVOKE.Animation_Pause(swigCPtr);
806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal Animation.States GetState()
811 Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr);
812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
817 /// Stops the animation.
821 NDalicPINVOKE.Animation_Stop(swigCPtr);
822 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
826 /// Clears the animation.<br>
827 /// This disconnects any objects that were being animated, effectively stopping the animation.<br>
831 NDalicPINVOKE.Animation_Clear(swigCPtr);
832 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835 internal AnimationSignal FinishedSignal()
837 AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false);
838 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
842 internal void AnimateBy(Property target, PropertyValue relativeValue)
844 NDalicPINVOKE.Animation_AnimateBy__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue));
845 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
848 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha)
850 NDalicPINVOKE.Animation_AnimateBy__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha));
851 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
854 internal void AnimateBy(Property target, PropertyValue relativeValue, TimePeriod period)
856 NDalicPINVOKE.Animation_AnimateBy__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), TimePeriod.getCPtr(period));
857 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
860 internal void AnimateBy(Property target, PropertyValue relativeValue, AlphaFunction alpha, TimePeriod period)
862 NDalicPINVOKE.Animation_AnimateBy__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(relativeValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
863 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866 internal void AnimateTo(Property target, PropertyValue destinationValue)
868 NDalicPINVOKE.Animation_AnimateTo__SWIG_0(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue));
869 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
872 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha)
874 NDalicPINVOKE.Animation_AnimateTo__SWIG_1(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha));
875 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
878 internal void AnimateTo(Property target, PropertyValue destinationValue, TimePeriod period)
880 NDalicPINVOKE.Animation_AnimateTo__SWIG_2(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), TimePeriod.getCPtr(period));
881 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
884 internal void AnimateTo(Property target, PropertyValue destinationValue, AlphaFunction alpha, TimePeriod period)
886 NDalicPINVOKE.Animation_AnimateTo__SWIG_3(swigCPtr, Property.getCPtr(target), PropertyValue.getCPtr(destinationValue), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
887 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
890 internal void AnimateBetween(Property target, KeyFrames keyFrames)
892 NDalicPINVOKE.Animation_AnimateBetween__SWIG_0(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames));
893 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
896 internal void AnimateBetween(Property target, KeyFrames keyFrames, Animation.Interpolation interpolation)
898 NDalicPINVOKE.Animation_AnimateBetween__SWIG_1(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), (int)interpolation);
899 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
902 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha)
904 NDalicPINVOKE.Animation_AnimateBetween__SWIG_2(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha));
905 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
908 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, Animation.Interpolation interpolation)
910 NDalicPINVOKE.Animation_AnimateBetween__SWIG_3(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), (int)interpolation);
911 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
914 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period)
916 NDalicPINVOKE.Animation_AnimateBetween__SWIG_4(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period));
917 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
920 internal void AnimateBetween(Property target, KeyFrames keyFrames, TimePeriod period, Animation.Interpolation interpolation)
922 NDalicPINVOKE.Animation_AnimateBetween__SWIG_5(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), TimePeriod.getCPtr(period), (int)interpolation);
923 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period)
928 NDalicPINVOKE.Animation_AnimateBetween__SWIG_6(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
929 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
932 internal void AnimateBetween(Property target, KeyFrames keyFrames, AlphaFunction alpha, TimePeriod period, Animation.Interpolation interpolation)
934 NDalicPINVOKE.Animation_AnimateBetween__SWIG_7(swigCPtr, Property.getCPtr(target), KeyFrames.getCPtr(keyFrames), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period), (int)interpolation);
935 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
938 internal void Animate(Actor actor, Path path, Vector3 forward)
940 NDalicPINVOKE.Animation_Animate__SWIG_0(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward));
941 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
944 internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha)
946 NDalicPINVOKE.Animation_Animate__SWIG_1(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha));
947 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
950 internal void Animate(Actor actor, Path path, Vector3 forward, TimePeriod period)
952 NDalicPINVOKE.Animation_Animate__SWIG_2(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), TimePeriod.getCPtr(period));
953 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
956 internal void Animate(Actor actor, Path path, Vector3 forward, AlphaFunction alpha, TimePeriod period)
958 NDalicPINVOKE.Animation_Animate__SWIG_3(swigCPtr, Actor.getCPtr(actor), Path.getCPtr(path), Vector3.getCPtr(forward), AlphaFunction.getCPtr(alpha), TimePeriod.getCPtr(period));
959 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
962 internal void Show(Actor actor, float delaySeconds)
964 NDalicPINVOKE.Animation_Show(swigCPtr, Actor.getCPtr(actor), delaySeconds);
965 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
968 internal void Hide(Actor actor, float delaySeconds)
970 NDalicPINVOKE.Animation_Hide(swigCPtr, Actor.getCPtr(actor), delaySeconds);
971 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
975 /// Enumeration for what to do when the animation ends, is stopped, or is destroyed.
977 public enum EndActions
980 /// When the animation ends, the animated property values are saved.
984 /// When the animation ends, the animated property values are forgotten.
988 /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel.
994 /// Enumeration for what interpolation method to use on key-frame animations.
996 public enum Interpolation
999 /// Values in between key frames are interpolated using a linear polynomial. (Default)
1003 /// Values in between key frames are interpolated using a cubic polynomial.
1009 /// Enumeration for what state the animation is in.
1011 /// <remarks>Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle.</remarks>
1015 /// Animation has stopped
1019 /// The animation is playing
1023 /// The animation is paused