Exemple #1
0
        public void Appear()
        {
            g_rotation = RANDOM.NextDouble() * 90d - 45d;
            g_pos_x    = RANDOM.NextDouble() * 160d - 80d;
            g_pos_y    = RANDOM.NextDouble() * 240d - 120d;

            if (_SpriteType == Control.SpriteType.Photo)
            {
                g_scale = 1d;
                double from_x = RANDOM.Next(2) == 0 ? -imageWidthInitial : App.SCREEN_WIDTH + imageWidthInitial;
                double from_y = RANDOM.Next(2) == 0 ? -imageHeightInitial : App.SCREEN_HEIGHT + imageHeightInitial;

                RotateAnimation.RotateFromTo(contentPanel, 0d, g_rotation, APPEAR_DURATION);
                MoveAnimation.MoveFromTo(contentPanel, from_x, from_y, g_pos_x, g_pos_y, APPEAR_DURATION, EASING,
                                         fe =>
                {
                    PrepareForManipulation();
                });
            }
            else if (_SpriteType == Control.SpriteType.Material || _SpriteType == Control.SpriteType.Text)
            {
                g_scale = RANDOM.NextDouble() * 0.3d + 0.8d;
                MoveAnimation.SetPosition(contentPanel, g_pos_x, g_pos_y);
                FadeAnimation.Fade(contentPanel, 0d, 1d, APPEAR_DURATION);
                RotateAnimation.RotateFromTo(contentPanel, 0d, g_rotation, APPEAR_DURATION);
                ScaleAnimation.ScaleFromTo(contentPanel, 1.5d, 1.5d, g_scale, g_scale, APPEAR_DURATION,
                                           fe =>
                {
                    ScaleAnimation.SetScale(fe, 1d, 1d);
                    PrepareForManipulation();
                });
            }
        }
Exemple #2
0
 private void KnobMove(bool right, bool useTransition)
 {
     if (knob != null)
     {
         double pos_x = this.Width * (right ? 0.5 : 0);
         if (useTransition)
         {
             MoveAnimation.MoveTo(knob, pos_x, 0, 200d);
         }
         else
         {
             MoveAnimation.SetPosition(knob, pos_x, 0);
         }
     }
 }