Esempio n. 1
0
File: Fade.cs Progetto: stratts/Wisp
        public override void Load()
        {
            rect = new Node();
            rect.AddChild(new Rect(new Point(viewport.X, viewport.Y), Color.Black));
            rect.GetFirstChildByType <Rect>().Opacity = 0;
            rect.GetFirstChildByType <Rect>().Name    = "fadeRect";
            var anim    = new AnimationGroup();
            var fadeIn  = anim.AddAnimation("fadeIn");
            var opacity = fadeIn.AddTrack(AnimationProperty.Opacity);

            opacity.Loop   = false;
            opacity.Length = 0.4f;
            opacity.Ease   = EaseType.Linear;
            opacity.AddFrame(0, 1);
            opacity.AddFrame(0.4f, 0);

            var fadeOut = anim.AddAnimation("fadeOut");

            opacity        = fadeOut.AddTrack(AnimationProperty.Opacity);
            opacity.Loop   = false;
            opacity.Length = 0.4f;
            opacity.Ease   = EaseType.Linear;
            opacity.AddFrame(0, 0);
            opacity.AddFrame(0.4f, 1);

            this.anim = (Animated)rect.AddComponent(new Animated(anim));
            this.anim.CurrentAnimation = "fadeOut";

            AddNode(rect);
            base.Load();
        }
Esempio n. 2
0
        public override void Load()
        {
            rect     = new Node();
            rect.Pos = new Vector2(0, 0);
            rect.AddChild(new Rect(new Point(viewport.X, viewport.Y), Color.Black));
            var anim   = new AnimationGroup();
            var fadeIn = anim.AddAnimation("slideIn");
            var posY   = fadeIn.AddTrack(AnimationProperty.PosY);

            posY.Loop   = false;
            posY.Length = 0.5f;
            posY.Ease   = EaseType.CubicEaseIn;
            posY.AddFrame(0, 0);
            posY.AddFrame(0.5f, -viewport.Y);

            var fadeOut = anim.AddAnimation("slideOut");

            posY        = fadeOut.AddTrack(AnimationProperty.PosY);
            posY.Loop   = false;
            posY.Length = 0.5f;
            posY.Ease   = EaseType.CubicEaseOut;
            posY.AddFrame(0, viewport.Y);
            posY.AddFrame(0.5f, 0);

            this.anim = (Animated)rect.AddComponent(new Animated(anim));
            this.anim.CurrentAnimation = "slideOut";

            AddNode(rect);
            base.Load();
        }
Esempio n. 3
0
    internal void StartCompletingAnimation(TileController objective)
    {
        Vector3 target   = objective.transform.localPosition - Vector3.up * 2;
        float   duration = PlayBoard.TURN_DURATION * 3;

        completingAnimation = gameObject.AddComponent <AnimationGroup>();
        completingAnimation.AddAnimation(ColorAnimation.CreateColorAnimation(Mesh, Color.clear, duration));
        completingAnimation.AddAnimation(objective.GetFillingAnimation(duration));
        completingAnimation.AddAnimation(MovementAnimation.CreateMovementAnimation(gameObject, target, duration));
        completingAnimation.StartAnimating();
    }