示例#1
0
        public GameObjectTest() : base(80, 23)
        {
            var textAnimation = new AnimatedSurface("default", 14, 5);           // Animated surface size. 14,5

            fallingText = new SadConsole.GameHelpers.GameObject(textAnimation);

            var editor = new SadConsole.Surfaces.SurfaceEditor(new SadConsole.Surfaces.BasicSurface(1, 1));

            for (int line = 0; line < 5; line++)
            {
                var frame = textAnimation.CreateFrame();
                editor.TextSurface = frame;
                editor.Fill(Color.Purple, Color.DarkGray, 178, null);                 // 219 178
                editor.Print(1, line, "Hello World!");
            }

            textAnimation.AnimationDuration = 1;             // Set it to -1 to make it faster than 1 sec
            textAnimation.Repeat            = true;

            textAnimation.Start();

            fallingText.Animation = textAnimation;
            //fallingText.Position = new Point(1,1);

            Children.Add(fallingText);
        }
示例#2
0
        public TextCursorConsole()
            : base(80, 23)
        {
            mouseCursor = new SadConsole.GameHelpers.GameObject(1, 1);
            mouseCursor.Animation.CurrentFrame.Cells[0].Glyph = 178;

            Children.Add(mouseCursor);
        }
示例#3
0
        public void OnSelected()
        {
            Brush = new SadConsole.GameHelpers.GameObject(1, 1, SadConsoleEditor.Settings.Config.ScreenFont);
            Brush.Animation.CreateFrame();
            Brush.IsVisible = false;
            RefreshTool();
            MainScreen.Instance.Brush = Brush;

            MainScreen.Instance.QuickSelectPane.CommonCharacterPickerPanel_ChangedHandler(CharacterPickPanel.SharedInstance, System.EventArgs.Empty);
            CharacterPickPanel.SharedInstance.Changed    += CharPanelChanged;
            MainScreen.Instance.QuickSelectPane.IsVisible = true;
        }
示例#4
0
        public GameObjectConsole()
            : base(80, 23)
        {
            var animation = new AnimatedSurface("default", 1, 1);
            var frame     = animation.CreateFrame();

            frame.Cells[0].Glyph = 1;

            player = new SadConsole.GameHelpers.GameObject(animation);
            //player.RepositionRects = true;
            player.Position        = new Point(textSurface.Width / 2, textSurface.Height / 2);
            playerPreviousPosition = player.Position;

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

            Children.Add(player);
        }
示例#5
0
        public LineTool()
        {
            frameEffect = new SadConsole.Effects.Fade()
            {
                UseCellBackground = true,
                FadeForeground    = true,
                FadeDuration      = 1f,
                AutoReverse       = true
            };

            lineCell = new Cell();

            settingsPanel = new LineToolPanel();
            ControlPanels = new CustomPanel[] { settingsPanel, CharacterPickPanel.SharedInstance };

            // Configure the animations
            Brush = new SadConsole.GameHelpers.GameObject(1, 1, SadConsoleEditor.Settings.Config.ScreenFont);
            AnimatedSurface animation = new AnimatedSurface("single", 1, 1, SadConsoleEditor.Settings.Config.ScreenFont);

            animation.CreateFrame()[0].Glyph = 42;
            Brush.Animations.Add(animation.Name, animation);
            ResetLine();
        }