Example #1
0
        private void loadManagers()
        {
            this.spriteManager = new SpriteManager(this);
            Components.Add(spriteManager);

            textureManager = new TextureManager(this);

            this.keyboardManager = new KeyboardManager(this);

            Components.Add(keyboardManager);

            //string[] strMenuTextures = {};

            //need to implement fonts etc for menu.
            //this.menuManager = new MenuManager(this, strMenuTextures,
            //    "Assets\\Fonts\\MenuFont", new Integer2(10, 10));

            this.mouseManager = new MouseManager(this, true);
            Components.Add(mouseManager);

            string[] menuTextures = {"Assets\\HUD\\pause_texture"};

            this.menuManager = new MenuManager(this, menuTextures, "Assets\\Fonts\\MenuFont", new Integer2(0, 0));

            this.soundManager = new SoundManager();
        }
Example #2
0
        public ScreenManager(Game game, GraphicsDeviceManager graphics, Integer2 screenResolution,
                             ScreenUtility.ScreenType screenType, ObjectManager objectManager, CameraManager cameraManager, KeyboardManager keyboardManager,
                             Keys pauseKey, EventDispatcher eventDispatcher, StatusType statusType)
            : base(game, eventDispatcher, statusType)
        {
            this.ScreenType    = screenType;
            this.objectManager = objectManager;
            this.cameraManager = cameraManager;

            //showing and hiding the menu - see ApplyUpdate()
            this.keyboardManager = keyboardManager;
            this.pauseKey        = pauseKey;

            this.graphics = graphics;

            //set the resolution using the property
            this.ScreenResolution   = screenResolution;
            this.fullScreenViewport = new Viewport(0, 0, screenResolution.X, screenResolution.Y);
        }
 //useful for objects that need access to ALL managers
 public ManagerParameters(MouseManager mouseManager, KeyboardManager keyboardManager, GamePadManager gamePadManager)
 {
     this.mouseManager    = mouseManager;
     this.keyboardManager = keyboardManager;
     this.gamePadManager  = gamePadManager;
 }
Example #4
0
 //removes necessity to specify starting screen type layout (e.g. single, multi)
 public ScreenManager(Game game, GraphicsDeviceManager graphics, Integer2 screenResolution,
                      ObjectManager objectManager, CameraManager cameraManager, KeyboardManager keyboardManager,
                      Keys pauseKey, EventDispatcher eventDispatcher, StatusType statusType)
     : this(game, graphics, screenResolution, ScreenUtility.ScreenType.SingleScreen, objectManager, cameraManager,
            keyboardManager, pauseKey, eventDispatcher, statusType)
 {
 }
        private void InitializeManagers(bool isMouseVisible)
        {
            this.physicsManager = new PhysicsManager(this, true);
            Components.Add(physicsManager);

            this.cameraManager = new CameraManager(this);
            Components.Add(this.cameraManager);

            this.keyboardManager = new KeyboardManager(this);
            Components.Add(this.keyboardManager);

            this.mouseManager = new MouseManager(this, isMouseVisible);
            //centre the mouse otherwise the movement for 1st person camera will be unpredictable
            this.mouseManager.SetPosition(this.screenCentre);
            Components.Add(this.mouseManager);

            this.objectManager = new ObjectManager(this, 10, 10, false);
            this.objectManager.DrawOrder = 1;
            Components.Add(this.objectManager);

            this.soundManager = new SoundManager(this,
                 "Content\\Assets\\Audio\\IxchelsQuestAudio.xgs",
                 "Content\\Assets\\Audio\\Wave Bank.xwb",
                "Content\\Assets\\Audio\\Sound Bank.xsb");
            Components.Add(this.soundManager);

            this.uiManager = new UIManager(this, 10, 10);
            this.uiManager.DrawOrder = 2; //always draw after object manager(1)
            Components.Add(this.uiManager);

            this.textureDictionary.Add("IButton", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioButton"));
            this.textureDictionary.Add("IButtonHighlighted", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioButtonHighlighted"));
            this.textureDictionary.Add("IAudio", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioMenu"));
            this.textureDictionary.Add("IAudioMenuMusic", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioMenuMusic"));
            this.textureDictionary.Add("IAudioMenuMute", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioMenuMute"));
            this.textureDictionary.Add("IAudioMenuReturn", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioMenuReturn"));
            this.textureDictionary.Add("IAudioMenuSFX", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/AudioMenuSFX"));
            this.textureDictionary.Add("IControlsMenu", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/ControlsMenu"));
            this.textureDictionary.Add("IControlsMenuReturn", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/ControlsMenuReturn"));
            this.textureDictionary.Add("IMainMenu", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/MainMenu"));
            this.textureDictionary.Add("IMainMenuOptions", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/MainMenuOptions"));
            this.textureDictionary.Add("IMainMenuQuit", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/MainMenuQuit"));
            this.textureDictionary.Add("IMainMEnuStart", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/MainMEnuStart"));
            this.textureDictionary.Add("IOptionsMenu", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/OptionsMenu"));
            this.textureDictionary.Add("IOptionsMenuAudio", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/OptionsMenuAudio"));
            this.textureDictionary.Add("IOptionsMenuControls", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/OptionsMenuControls"));
            this.textureDictionary.Add("IOptionsMenuReturn", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/OptionsMenuReturn"));
            this.textureDictionary.Add("IPauseMenu", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/PauseMenu"));
            this.textureDictionary.Add("IPauseMenuOptions", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/PauseMenuOptions"));
            this.textureDictionary.Add("IPauseMenuQuit", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/PauseMenuQuit"));
            this.textureDictionary.Add("IPauseMenuRestart", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/PauseMenuRestart"));
            this.textureDictionary.Add("IPauseMenuResume", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/PauseMenuResume"));
            this.textureDictionary.Add("IYouLose", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouLose"));
            this.textureDictionary.Add("IYouLoseQuit", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouLoseQuit"));
            this.textureDictionary.Add("IYouLoseRestart", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouLoseRestart"));
            this.textureDictionary.Add("IYouWin", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouWin"));
            this.textureDictionary.Add("IYouWinQuit", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouWinQuit"));
            this.textureDictionary.Add("IYouWinRestart", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/YouWinRestart"));
            this.textureDictionary.Add("IX", Content.Load<Texture2D>("Assets/Textures/Menu/IxChel/X"));

            Texture2D[] menuTexturesArray = {
                                                this.textureDictionary["IButton"],
                                                this.textureDictionary["IButtonHighlighted"],
                                                this.textureDictionary["IAudio"],
                                                this.textureDictionary["IAudioMenuMusic"],
                                                this.textureDictionary["IAudioMenuMute"],
                                                this.textureDictionary["IAudioMenuReturn"],
                                                this.textureDictionary["IAudioMenuSFX"],
                                                this.textureDictionary["IControlsMenu"],
                                                this.textureDictionary["IControlsMenuReturn"],
                                                this.textureDictionary["IMainMenu"],
                                                this.textureDictionary["IMainMenuOptions"],
                                                this.textureDictionary["IMainMenuQuit"],
                                                this.textureDictionary["IMainMEnuStart"],
                                                this.textureDictionary["IOptionsMenu"],
                                                this.textureDictionary["IOptionsMenuAudio"],
                                                this.textureDictionary["IOptionsMenuControls"],
                                                this.textureDictionary["IOptionsMenuReturn"],
                                                this.textureDictionary["IPauseMenu"],
                                                this.textureDictionary["IPauseMenuOptions"],
                                                this.textureDictionary["IPauseMenuQuit"],
                                                this.textureDictionary["IPauseMenuRestart"],
                                                this.textureDictionary["IPauseMenuResume"],
                                                this.textureDictionary["IYouLose"],
                                                this.textureDictionary["IYouLoseQuit"],
                                                this.textureDictionary["IYouLoseRestart"],
                                                this.textureDictionary["IYouWin"],
                                                this.textureDictionary["IYouWinQuit"],
                                                this.textureDictionary["IYouWinRestart"],
                                                this.textureDictionary["IX"]
                                            };

            this.menuManager = new MenuManager(this, menuTexturesArray, this.fontDictionary["menu"], MenuData.MenuTexturePadding, MenuData.MenuTextureColor);
            this.menuManager.DrawOrder = 3; //always draw after ui manager(2)
            Components.Add(this.menuManager);
        }