Пример #1
0
        private async void ButtonTapped(object sender, TappedRoutedEventArgs e)
        {
            FlipAnimation.Begin();
            await Task.Delay(1000);

            PressButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }
Пример #2
0
 private void ExecutivesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (ExecutivesListBox.SelectedIndex != -1)
     {
         FlipAnimation.Begin();
     }
 }
Пример #3
0
        private void flip()
        {
            FlipAnimation flipAnimation = new FlipAnimation(mTopImage, mTileImage);

            if (mTopImage.Visibility == ViewStates.Gone)
            {
                flipAnimation.reverse();
            }
            StartAnimation(flipAnimation);
        }
        private static AnimationDefinition GetAnimationDefinition(string animationName)
        {
            AnimationDefinition animationDefinition = null;

            if (animationName != null)
            {
                switch (animationName.ToLower())
                {
                case "flash": animationDefinition = new FlashAnimation(); break;

                case "bounce": animationDefinition = new BounceAnimation(); break;

                case "shake": animationDefinition = new ShakeAnimation(); break;

                case "tada": animationDefinition = new TadaAnimation(); break;

                case "swing": animationDefinition = new SwingAnimation(); break;

                case "wobble": animationDefinition = new WobbleAnimation(); break;

                case "pulse": animationDefinition = new PulseAnimation(); break;

                case "breathing": animationDefinition = new BreathingAnimation(); break;

                case "jump": animationDefinition = new JumpAnimation(); break;

                case "flip": animationDefinition = new FlipAnimation(); break;

                case "flipinx": animationDefinition = new FlipInXAnimation(); break;

                case "flipoutx": animationDefinition = new FlipOutXAnimation(); break;

                case "flipiny": animationDefinition = new FlipInYAnimation(); break;

                case "flipouty": animationDefinition = new FlipOutYAnimation(); break;

                case "fadein": animationDefinition = new FadeInAnimation(); break;

                case "fadeout": animationDefinition = new FadeOutAnimation(); break;

                case "fadeinleft": animationDefinition = new FadeInLeftAnimation(); break;

                case "fadeinright": animationDefinition = new FadeInRightAnimation(); break;

                case "fadeinup": animationDefinition = new FadeInUpAnimation(); break;

                case "fadeindown": animationDefinition = new FadeInDownAnimation(); break;

                case "fadeoutleft": animationDefinition = new FadeOutLeftAnimation(); break;

                case "fadeoutright": animationDefinition = new FadeOutRightAnimation(); break;

                case "fadeoutup": animationDefinition = new FadeOutUpAnimation(); break;

                case "fadeoutdown": animationDefinition = new FadeOutDownAnimation(); break;

                case "bouncein": animationDefinition = new BounceInAnimation(); break;

                case "bounceout": animationDefinition = new BounceOutAnimation(); break;

                case "bounceinleft": animationDefinition = new BounceInLeftAnimation(); break;

                case "bounceinright": animationDefinition = new BounceInRightAnimation(); break;

                case "bounceinup": animationDefinition = new BounceInUpAnimation(); break;

                case "bounceindown": animationDefinition = new BounceInDownAnimation(); break;

                case "bounceoutleft": animationDefinition = new BounceOutLeftAnimation(); break;

                case "bounceoutright": animationDefinition = new BounceOutRightAnimation(); break;

                case "bounceoutup": animationDefinition = new BounceOutUpAnimation(); break;

                case "bounceoutdown": animationDefinition = new BounceOutDownAnimation(); break;

                case "scalein": animationDefinition = new ScaleInAnimation(); break;

                case "scaleout": animationDefinition = new ScaleOutAnimation(); break;

                case "lightspeedinleft": animationDefinition = new LightSpeedInLeftAnimation(); break;

                case "lightspeedinright": animationDefinition = new LightSpeedInRightAnimation(); break;

                case "lightspeedoutleft": animationDefinition = new LightSpeedOutLeftAnimation(); break;

                case "lightspeedoutright": animationDefinition = new LightSpeedOutRightAnimation(); break;

                case "hinge": animationDefinition = new HingeAnimation(); break;

                case "reset": animationDefinition = new ResetAnimation(); break;
                }
            }
            return(animationDefinition);
        }
Пример #5
0
 private static AnimationDefinition GetAnimationDefinition(string animationName)
 {
     AnimationDefinition animationDefinition = null;
     if (animationName != null)
     {
         switch (animationName.ToLower())
         {
             case "flash": animationDefinition = new FlashAnimation(); break;
             case "bounce": animationDefinition = new BounceAnimation(); break;
             case "shake": animationDefinition = new ShakeAnimation(); break;
             case "tada": animationDefinition = new TadaAnimation(); break;
             case "swing": animationDefinition = new SwingAnimation(); break;
             case "wobble": animationDefinition = new WobbleAnimation(); break;
             case "pulse": animationDefinition = new PulseAnimation(); break;
             case "breathing": animationDefinition = new BreathingAnimation(); break;
             case "jump": animationDefinition = new JumpAnimation(); break;
             case "flip": animationDefinition = new FlipAnimation(); break;
             case "flipinx": animationDefinition = new FlipInXAnimation(); break;
             case "flipoutx": animationDefinition = new FlipOutXAnimation(); break;
             case "flipiny": animationDefinition = new FlipInYAnimation(); break;
             case "flipouty": animationDefinition = new FlipOutYAnimation(); break;
             case "fadein": animationDefinition = new FadeInAnimation(); break;
             case "fadeout": animationDefinition = new FadeOutAnimation(); break;
             case "fadeinleft": animationDefinition = new FadeInLeftAnimation(); break;
             case "fadeinright": animationDefinition = new FadeInRightAnimation(); break;
             case "fadeinup": animationDefinition = new FadeInUpAnimation(); break;
             case "fadeindown": animationDefinition = new FadeInDownAnimation(); break;
             case "fadeoutleft": animationDefinition = new FadeOutLeftAnimation(); break;
             case "fadeoutright": animationDefinition = new FadeOutRightAnimation(); break;
             case "fadeoutup": animationDefinition = new FadeOutUpAnimation(); break;
             case "fadeoutdown": animationDefinition = new FadeOutDownAnimation(); break;
             case "bouncein": animationDefinition = new BounceInAnimation(); break;
             case "bounceout": animationDefinition = new BounceOutAnimation(); break;
             case "bounceinleft": animationDefinition = new BounceInLeftAnimation(); break;
             case "bounceinright": animationDefinition = new BounceInRightAnimation(); break;
             case "bounceinup": animationDefinition = new BounceInUpAnimation(); break;
             case "bounceindown": animationDefinition = new BounceInDownAnimation(); break;
             case "bounceoutleft": animationDefinition = new BounceOutLeftAnimation(); break;
             case "bounceoutright": animationDefinition = new BounceOutRightAnimation(); break;
             case "bounceoutup": animationDefinition = new BounceOutUpAnimation(); break;
             case "bounceoutdown": animationDefinition = new BounceOutDownAnimation(); break;
             case "scalein": animationDefinition = new ScaleInAnimation(); break;
             case "scaleout": animationDefinition = new ScaleOutAnimation(); break;
             case "lightspeedinleft": animationDefinition = new LightSpeedInLeftAnimation(); break;
             case "lightspeedinright": animationDefinition = new LightSpeedInRightAnimation(); break;
             case "lightspeedoutleft": animationDefinition = new LightSpeedOutLeftAnimation(); break;
             case "lightspeedoutright": animationDefinition = new LightSpeedOutRightAnimation(); break;
             case "hinge": animationDefinition = new HingeAnimation(); break;
             case "reset": animationDefinition = new ResetAnimation(); break;
         }
     }
     return animationDefinition;
 }
Пример #6
0
        public CardEntity2D(IObject2DFactory factory, ALayer2D layer2D, CardEntity entity) :
            base(layer2D, factory, true)
        {
            this.cardHalo  = new CardHalo2D(factory, layer2D, this);
            this.cardLabel = new CardLabel2D(layer2D, entity.CardValue);

            this.ObjectSprite.Texture = factory.GetTextureById("backCardTexture");

            this.ObjectSprite.Origin = new Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2);

            this.canevasSprite = new Sprite();

            this.canevasSprite.TextureRect = new IntRect(0, 0, this.ObjectSprite.TextureRect.Width + 2 * WIDTH_BORDER, this.ObjectSprite.TextureRect.Height + 2 * WIDTH_BORDER);

            this.canevasSprite.Origin = new Vector2f(this.canevasSprite.TextureRect.Width / 2, this.canevasSprite.TextureRect.Height / 2);

            this.Position = entity.Position;
            this.Rotation = entity.Rotation;

            this.canevasSprite.Color = Color.Black;
            this.playerColor         = Color.Black;
            this.isSocketed          = entity.ParentStar == null;
            this.ratioColor          = -1;
            this.isFocused           = true;
            this.isSelected          = !entity.IsSelected;

            Shader shader = new Shader(null, null, @"Assets\Graphics\Shaders\CardCanevas.frag");

            Texture distortionMap = factory.GetTextureById("distorsionTexture");

            distortionMap.Repeated     = true;
            distortionMap.Smooth       = true;
            this.canevasSprite.Texture = distortionMap;
            shader.SetUniform("distortionMapTexture", distortionMap);

            render        = new RenderStates(BlendMode.Alpha);
            render.Shader = shader;

            //SequenceAnimation flipAnimation = new SequenceAnimation(Time.FromSeconds(1), AnimationType.ONETIME);
            IAnimation animation = new FlipAnimation(0, (float)(Math.PI / 2), Time.FromSeconds(TIME_FLIP), AnimationType.ONETIME, InterpolationMethod.LINEAR, 1);

            //flipAnimation.AddAnimation(0, animation);
            this.animationsList.Add(animation);

            animation = new FlipAnimation((float)(Math.PI / 2), 0, Time.FromSeconds(TIME_FLIP), AnimationType.ONETIME, InterpolationMethod.LINEAR, 1);
            //flipAnimation.AddAnimation(0.5f, animation);
            this.animationsList.Add(animation);

            SequenceAnimation sequenceAnimation = new SequenceAnimation(Time.FromSeconds(1f), AnimationType.LOOP);

            animation = new ZoomAnimation(0.9f, 1.1f, Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR);
            sequenceAnimation.AddAnimation(0, animation);

            animation = new ZoomAnimation(1.1f, 0.9f, Time.FromSeconds(0.5f), AnimationType.ONETIME, InterpolationMethod.LINEAR);
            sequenceAnimation.AddAnimation(0.5f, animation);
            this.animationsList.Add(sequenceAnimation);

            this.Initialize(entity);

            this.UpdateScaling();
            render.Shader.SetUniform("margin", (WIDTH_BORDER - 5f) / this.canevasSprite.Texture.Size.X);
            render.Shader.SetUniform("outMargin", 2f / this.canevasSprite.Texture.Size.X);
            render.Shader.SetUniform("radius", RADIUS_BORDER / this.canevasSprite.Texture.Size.X);
        }