コード例 #1
0
ファイル: Tween.cs プロジェクト: mtesseracttech/NeonArkanoid
 /// <summary>
 /// Factory creating a new instantaneous interpolation (thus this is not
 /// really an interpolation).
 /// </summary>
 /// <remarks>
 /// Factory creating a new instantaneous interpolation (thus this is not
 /// really an interpolation).
 /// <br/><br/>
 /// <b>You need to set the target values of the interpolation by using one
 /// of the target() methods</b>. The interpolation will set the target
 /// attribute to these values after the delay (if any).
 /// <br/><br/>
 /// The common use of Tweens is "fire-and-forget": you do not need to care
 /// for tweens once you added them to a TweenManager, they will be updated
 /// automatically, and cleaned once finished. Common call:
 /// <br/><br/>
 /// <pre>
 /// <code>
 /// Tween.set(myObject, POSITION)
 /// .target(50, 70)
 /// .delay(1.0f)
 /// .start(myManager);
 /// </code>
 /// </pre>
 /// Several options such as delay, repetitions and callbacks can be added to
 /// the tween.
 /// </remarks>
 /// <param name="target">The target object of the interpolation.</param>
 /// <param name="tweenType">The desired type of interpolation.</param>
 /// <returns>The generated Tween.</returns>
 public static TweenEngine.Tween Set(object target, int tweenType)
 {
     TweenEngine.Tween tween = pool.Get();
     tween.Setup(target, tweenType, 0);
     tween.Ease(Quad.INOUT);
     return(tween);
 }
コード例 #2
0
ファイル: Tween.cs プロジェクト: mtesseracttech/NeonArkanoid
 /// <summary>Factory creating a new timer.</summary>
 /// <remarks>
 /// Factory creating a new timer. The given callback will be triggered on
 /// each iteration start, after the delay.
 /// <br/><br/>
 /// The common use of Tweens is "fire-and-forget": you do not need to care
 /// for tweens once you added them to a TweenManager, they will be updated
 /// automatically, and cleaned once finished. Common call:
 /// <br/><br/>
 /// <pre>
 /// <code>
 /// Tween.call(myCallback)
 /// .delay(1.0f)
 /// .repeat(10, 1000)
 /// .start(myManager);
 /// </code>
 /// </pre>
 /// </remarks>
 /// <param name="callback">
 /// The callback that will be triggered on each iteration
 /// start.
 /// </param>
 /// <returns>The generated Tween.</returns>
 /// <seealso cref="TweenCallback">TweenCallback</seealso>
 public static TweenEngine.Tween Call(TweenCallback callback)
 {
     TweenEngine.Tween tween = pool.Get();
     tween.Setup(null, -1, 0);
     tween.SetCallback(callback);
     tween.SetCallbackTriggers(TweenCallback.START);
     return(tween);
 }
コード例 #3
0
ファイル: Tween.cs プロジェクト: mtesseracttech/NeonArkanoid
 // -------------------------------------------------------------------------
 // Static -- factories
 // -------------------------------------------------------------------------
 /// <summary>Factory creating a new standard interpolation.</summary>
 /// <remarks>
 /// Factory creating a new standard interpolation. This is the most common
 /// type of interpolation. The starting values are retrieved automatically
 /// after the delay (if any).
 /// <br/><br/>
 /// <b>You need to set the target values of the interpolation by using one
 /// of the target() methods</b>. The interpolation will run from the
 /// starting values to these target values.
 /// <br/><br/>
 /// The common use of Tweens is "fire-and-forget": you do not need to care
 /// for tweens once you added them to a TweenManager, they will be updated
 /// automatically, and cleaned once finished. Common call:
 /// <br/><br/>
 /// <pre>
 /// <code>
 /// Tween.to(myObject, POSITION, 1.0f)
 /// .target(50, 70)
 /// .ease(Quad.INOUT)
 /// .start(myManager);
 /// </code>
 /// </pre>
 /// Several options such as delay, repetitions and callbacks can be added to
 /// the tween.
 /// </remarks>
 /// <param name="target">The target object of the interpolation.</param>
 /// <param name="tweenType">The desired type of interpolation.</param>
 /// <param name="duration">The duration of the interpolation, in milliseconds.</param>
 /// <returns>The generated Tween.</returns>
 public static TweenEngine.Tween To(object target, int tweenType, float duration)
 {
     TweenEngine.Tween tween = pool.Get();
     tween.Setup(target, tweenType, duration);
     tween.Ease(Quad.INOUT);
     tween.Path(TweenPaths.catmullRom);
     return(tween);
 }
コード例 #4
0
ファイル: Tween.cs プロジェクト: mtesseracttech/NeonArkanoid
 /// <summary>Convenience method to create an empty tween.</summary>
 /// <remarks>
 /// Convenience method to create an empty tween. Such object is only useful
 /// when placed inside animation sequences (see
 /// <see cref="Timeline">Timeline</see>
 /// ), in which
 /// it may act as a beacon, so you can set a callback on it in order to
 /// trigger some action at the right moment.
 /// </remarks>
 /// <returns>The generated Tween.</returns>
 /// <seealso cref="Timeline">Timeline</seealso>
 public static TweenEngine.Tween Mark()
 {
     TweenEngine.Tween tween = pool.Get();
     tween.Setup(null, -1, 0);
     return(tween);
 }