Ejemplo n.º 1
0
        public LevelScreen(LoderGame game, SystemManager systemManager, EntityManager entityManager)
            : base(game.screenSystem, ScreenType.Level)
        {
            _game                  = game;
            _systemManager         = systemManager;
            _entityManager         = entityManager;
            _levelSystem           = (LevelSystem)_systemManager.getSystem(SystemType.Level);
            _content               = new ContentManager(_game.Services);
            _content.RootDirectory = "Content";
            _equipmentSystem       = (EquipmentSystem)_systemManager.getSystem(SystemType.Equipment);
            _playerId              = PlayerSystem.PLAYER_ID;
            _pixel                 = new Texture2D(_game.GraphicsDevice, 1, 1);
            _pixel.SetData <Color>(new[] { Color.White });
            _arial              = _content.Load <SpriteFont>("arial");
            _dialogePanes       = new List <InteractiveDialoguePane>();
            _dialogueFont       = _content.Load <SpriteFont>("shared_ui/dialogue_font");
            _dialogueOptionFont = _content.Load <SpriteFont>("shared_ui/dialogue_option_font");

            ToolbarComponent toolbarComponent = (ToolbarComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Toolbar);

            _toolbarDisplay           = new ToolbarDisplay(_game.spriteBatch, _equipmentSystem, toolbarComponent);
            _inventoryDisplay         = new InventoryDisplay(_game.spriteBatch, _equipmentSystem, (InventoryComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Inventory), toolbarComponent);
            _inventoryDisplay.inFocus = false;
            _toolbarDisplay.inFocus   = true;

            _healthBar = new LargeHealthBar(_game.spriteBatch);
        }
Ejemplo n.º 2
0
        public LevelScreen(LoderGame game, SystemManager systemManager, EntityManager entityManager)
            : base(game.screenSystem, ScreenType.Level)
        {
            _game = game;
            _systemManager = systemManager;
            _entityManager = entityManager;
            _levelSystem = (LevelSystem)_systemManager.getSystem(SystemType.Level);
            _content = new ContentManager(_game.Services);
            _content.RootDirectory = "Content";
            _equipmentSystem = (EquipmentSystem)_systemManager.getSystem(SystemType.Equipment);
            _playerId = PlayerSystem.PLAYER_ID;
            _pixel = new Texture2D(_game.GraphicsDevice, 1, 1);
            _pixel.SetData<Color>(new[] { Color.White });
            _arial = _content.Load<SpriteFont>("arial");
            _dialogePanes = new List<InteractiveDialoguePane>();
            _dialogueFont = _content.Load<SpriteFont>("shared_ui/dialogue_font");
            _dialogueOptionFont = _content.Load<SpriteFont>("shared_ui/dialogue_option_font");

            ToolbarComponent toolbarComponent = (ToolbarComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Toolbar);

            _toolbarDisplay = new ToolbarDisplay(_game.spriteBatch, _equipmentSystem, toolbarComponent);
            _inventoryDisplay = new InventoryDisplay(_game.spriteBatch, _equipmentSystem, (InventoryComponent)_entityManager.getComponent(LevelSystem.currentLevelUid, _playerId, ComponentType.Inventory), toolbarComponent);
            _inventoryDisplay.inFocus = false;
            _toolbarDisplay.inFocus = true;

            _healthBar = new LargeHealthBar(_game.spriteBatch);
        }