Exemplo n.º 1
0
 public GameConsole(Game game, SpriteBatch spriteBatch, IEnumerable<IConsoleCommand> commands, GameConsoleOptions options)
 {
     var content = new ResourceContentManager(game.Services, Resource1.ResourceManager);
     if (options.Font == null)
     {
         options.Font = content.Load<SpriteFont>("ConsoleFont");
     }
     options.RoundedCorner = content.Load<Texture2D>("roundedCorner");
     GameConsoleOptions.Options = options;
     GameConsoleOptions.Commands = commands.ToList();
     Enabled = true;
     console = new GameConsoleComponent(this, game, spriteBatch);
     game.Services.AddService(typeof(GameConsole), this);
     game.Components.Add(console);
 }
Exemplo n.º 2
0
        public GameConsole(Game game, SpriteBatch spriteBatch, IEnumerable <IConsoleCommand> commands, GameConsoleOptions options)
        {
            var content = new ResourceContentManager(game.Services, Resource1.ResourceManager);

            if (options.Font == null)
            {
                options.Font = content.Load <SpriteFont>("ConsoleFont");
            }
            options.RoundedCorner       = content.Load <Texture2D>("roundedCorner");
            GameConsoleOptions.Options  = options;
            GameConsoleOptions.Commands = commands.ToList();
            Enabled = true;
            console = new GameConsoleComponent(this, game, spriteBatch);
            game.Services.AddService(typeof(GameConsole), this);
            game.Components.Add(console);
        }