Exemple #1
0
        public override bool ProcessKeyboard(Keyboard info)
        {
            if (info.IsKeyReleased(Microsoft.Xna.Framework.Input.Keys.Space))
            {
                animation.Restart();
            }

            return(base.ProcessKeyboard(info));
        }
Exemple #2
0
        public PreviewAnimationPopup(AnimatedSurface animation) : base(animation.Width + 2, animation.Height + 4)
        {
            textSurface.Font = Settings.Config.ScreenFont;
            this.animation   = animation;

            CloseOnESC       = true;
            entity           = new GameObject(1, 1, Settings.Config.ScreenFont);
            entity.Position  = new Point(1, 1);
            entity.Animation = animation;
            animation.Restart();
            entity.Animation.Start();
            entity.Position = new Point(1);
            Children.Add(entity);

            restartAnimation          = new Button(animation.Width, 1);
            restartAnimation.Text     = "Restart";
            restartAnimation.Position = new Point(1, TextSurface.Height - 2);
            restartAnimation.Click   += (s, e) => this.animation.Restart();
            Add(restartAnimation);
        }