public GameConsoleComponent(GameConsole console, Game game, SpriteBatch spriteBatch)
            : base(game)
        {
            this.console = console;
            this.spriteBatch = spriteBatch;

            inputProcesser = new InputProcessor(new CommandProcesser(), game.Window);

            inputProcesser.Open += (s, e) => renderer.Open();
            inputProcesser.Close += (s, e) => renderer.Close();

            renderer = new Renderer(game, spriteBatch, inputProcesser);
            var inbuiltCommands = new IConsoleCommand[] { new ClearScreenCommand(inputProcesser), new ExitCommand(game), new HelpCommand() };
            GameConsoleOptions.Commands.AddRange(inbuiltCommands);
        }
示例#2
0
        private void SetupConsole()
        {
            console = new GameConsole(this, spriteBatch);

            ResetConsoleCommands();

            console.Options.Prompt = ">";
            console.Options.ToggleKey = Keys.F1;
            console.Options.BackgroundColor = new Color(0, 0, 0, 190);
        }