/// <summary> /// Move the new scene in from right to left on top of old scene /// </summary> public static Transition MoveLeft() => new Transition( Animation.Move(new Vector2(Window.Size.x, 0), Vector2.Zero), null, true);
/// <summary> /// Push the old scene out towards the right /// </summary> /// <returns></returns> public static Transition PushRight() => new Transition( Animation.Move(new Vector2(-Window.Size.x, 0), Vector2.Zero), Animation.Move(Vector2.Zero, new Vector2(Window.Size.x, 0)), true);
/// <summary> /// Move the old scene to the left to reveal the new scene below it /// </summary> public static Transition RevealLeft() => new Transition( null, Animation.Move(Vector2.Zero, new Vector2(-Window.Size.x, 0)), false);
/// <summary> /// Move the new scene in from right to left on top of old scene /// </summary> public static Transition RevealRight() => new Transition( null, Animation.Move(Vector2.Zero, new Vector2(Window.Size.x, 0)), true);
public Animation Instantiate() { if (null == _tweens) { return(null); } Animation tween = IsSequence ? Animation.Sequence() : Animation.Group(); for (int i = 0; i < _tweens.Length; i++) { Animation child = null; switch (_tweens[i].Type) { case TweenType.Move: child = Animation.Move(_tweens[i].From, _tweens[i].To); break; case TweenType.Fade: child = Animation.Fade(_tweens[i].From.x, _tweens[i].To.x); break; case TweenType.Color: child = Animation.Color( new Color(_tweens[i].From.x, _tweens[i].From.y, _tweens[i].From.z), new Color(_tweens[i].To.x, _tweens[i].To.y, _tweens[i].To.z) ); break; case TweenType.Scale: child = Animation.Scale(_tweens[i].From.x, _tweens[i].To.x); break; case TweenType.ShakePosition: child = Animation.ShakePosition(_tweens[i].From); break; case TweenType.ShakeRotation: child = Animation.ShakeRotation(_tweens[i].From); break; case TweenType.Play: child = Animation.Play(_tweens[i].Object as AudioClip, _tweens[i].From.x, _tweens[i].From.y); break; case TweenType.Wait: child = Animation.Wait(0f); break; case TweenType.Activate: child = Animation.Activate(_tweens[i].From.x > 0); break; } if (!string.IsNullOrWhiteSpace(_tweens[i].Target)) { child.Target(_tweens[i].Target); } child.Easing(_tweens[i].Easing, _tweens[i].EasingParam1, _tweens[i].EasingParam2); child.PingPong(_tweens[i].IsPingPong); child.Loop(_tweens[i].IsLooping); child.Duration(_tweens[i].Duration); child.Delay(_tweens[i].Delay); if (_tweens[i].IsLowPriority) { child.LowPriority(); } tween.Child(child); } if (!string.IsNullOrWhiteSpace(_target)) { tween.Target(_target); } tween.Loop(IsLooping); tween.PingPong(IsPingPong); if (IsLowPriority) { tween.LowPriority(); } if (DurationOverride) { tween.Duration(Duration); } tween.Delay(Delay); return(tween); }