示例#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();
                });
            }
        }
示例#2
0
        public void Appear()
        {
            g_rotation = RANDOM.NextDouble() * 90d - 45d;
            g_pos_x    = RANDOM.NextDouble() * 160d - 80d;
            g_pos_y    = RANDOM.NextDouble() * 240d - 120d;
            g_scale    = RANDOM.NextDouble() * 0.3d + 0.8d;

            double from_x = RANDOM.NextDouble() * 160d - 80d;
            double from_y = RANDOM.NextDouble() * 240d - 120d;

            MoveAnimation.MoveFromTo(contentPanel, from_x, from_y, g_pos_x, g_pos_y, APPEAR_DURATION, EASING,
                                     fe =>
            {
                PrepareForManipulation();
                //this.Selected = true;
            });

            RotateAnimation.RotateFromTo(contentPanel, 0d, g_rotation, APPEAR_DURATION);
            //ScaleAnimation.ScaleFromTo(contentPanel, 1d, 1d, g_scale, g_scale, APPEAR_DURATION);
            ScaleAnimation.SetScale(contentPanel, g_scale, g_scale);
        }