예제 #1
0
        public EntityConsole()
            : base(80, 23)
        {
            var         animation = new AnimatedConsole("default", 1, 1);
            CellSurface frame     = animation.CreateFrame();

            frame.Cells[0].Glyph = 1;
            frame.SetDecorator(0, 2, new CellDecorator(Color.Yellow, 69, SpriteEffects.None));

            player = new Entity(animation)
            {
                Position = new Point(Width / 2, Height / 2)
            };
            player.Components.Add(new SadConsole.Components.EntityViewSyncComponent());
            playerPreviousPosition = player.Position;

            Children.Add(player);

            // Setup this console to accept keyboard input.
            UseKeyboard = true;
            IsVisible   = false;
        }