예제 #1
0
        protected override void PopIn()
        {
            var leftExplosion = new TriangleExplosion(RNG.Next(3, 5))
            {
                Anchor = Anchor.Centre, Origin = Anchor.Centre
            };
            var rightExplosion = new TriangleExplosion(RNG.Next(3, 5))
            {
                Anchor = Anchor.Centre, Origin = Anchor.Centre
            };

            ((TauCursor)Parent).Add(leftExplosion);
            ((TauCursor)Parent).Add(rightExplosion);

            paddle.TransformBindableTo(paddle.Current, angleRange / 360, 500, Easing.InExpo);
            paddle.RotateTo(-angleRange / 2, 500, Easing.InExpo);

            // We're using a scheduler here because we require Rotation to be up-to-date when we're setting the position.
            Scheduler.AddDelayed(() =>
            {
                leftExplosion.Rotation  = -90 + -(angleRange / 2) + Rotation;
                rightExplosion.Rotation = 90 + angleRange / 2 + Rotation;

                leftExplosion.Position  = Extensions.GetCircularPosition(DrawHeight / 2 * (1 - 0.025f), -(angleRange / 2) + Rotation);
                rightExplosion.Position = Extensions.GetCircularPosition(DrawHeight / 2 * (1 - 0.025f), (angleRange / 2) + Rotation);

                leftExplosion.Show();
                rightExplosion.Show();
            }, 500);
        }
예제 #2
0
 public static TransformSequence <CircularProgress> FillTo(this CircularProgress t, double newValue, double duration = 0, Easing easing = Easing.None)
 => t.TransformBindableTo(t.Current, newValue, duration, easing);