Example #1
0
        private static void Init()
        {
            // Any setup
            if (Settings.UnlimitedFPS)
            {
                SadConsole.Game.Instance.Components.Add(new SadConsole.Game.FPSCounterComponent(SadConsole.Game.Instance));
            }

            // Setup our custom theme.
            Theme.SetupThemes();

            SadConsole.Game.Instance.Window.Title = "DemoProject Core";

            // By default SadConsole adds a blank ready-to-go console to the rendering system.
            // We don't want to use that for the sample project so we'll remove it.

            //Global.MouseState.ProcessMouseWhenOffScreen = true;

            MainConsole = new Container();

            // We'll instead use our demo consoles that show various features of SadConsole.
            Global.CurrentScreen = MainConsole;

            // Initialize the windows
            _characterWindow = new Windows.CharacterViewer();


            Console con = new Console(80, 25);

            con.Print(1, 1, "Hello, welcome to SadConsole", Color.Yellow);
            con.SetForeground(4, 1, Color.Brown);
            con.SetForeground(5, 1, Color.Brown);
            con.SetGlyph(6, 1, '!');
            con.Cursor.Move(1, 20).Print("Printing with cursor");
        }
Example #2
0
        private void DrawCharacter(int x, int y, int character, Color?colour = null)
        {
            if (colour.HasValue)
            {
                mainConsole.SetForeground(x, y, colour.Value);
            }

            mainConsole.SetGlyph(x, y, character);
        }