Beispiel #1
0
 public MyMenuManager(Game game, InputManagerParameters inputManagerParameters, CameraManager cameraManager,
                      SpriteBatch spriteBatch, EventDispatcher eventDispatcher, StatusType statusType)
     : base(game, inputManagerParameters, cameraManager, spriteBatch, eventDispatcher, statusType)
 {
 }
Beispiel #2
0
        protected override void Initialize()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //add the component to handle all system events
            this.eventDispatcher = new EventDispatcher(this, 20);
            Components.Add(this.eventDispatcher);

            this.resolution   = ScreenUtility.XVGA;
            this.screenCentre = this.resolution / 2;

            InitializeGraphics();
            InitializeEffects();
            InitializeDictionaries();

            LoadAssets();

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

            //Mouse
            bool bMouseVisible = true;

            this.mouseManager = new MouseManager(this, bMouseVisible);
            this.mouseManager.SetPosition(this.screenCentre);
            Components.Add(this.mouseManager);

            //bundle together for easy passing
            this.inputManagerParameters = new InputManagerParameters(this.mouseManager, this.keyboardManager);

            //this is a list that updates all cameras
            this.cameraManager = new CameraManager(this, 3);
            Components.Add(this.cameraManager);

            //Object3D
            this.object3DManager = new ObjectManager(this, this.cameraManager, this.eventDispatcher, StatusType.Drawn | StatusType.Update);
            Components.Add(this.object3DManager);

            //Sound
            this.soundManager = new SoundManager(this, this.eventDispatcher, StatusType.Update, "Content/Assets/Audio/", "Demo2DSound.xgs", "WaveBank1.xwb", "SoundBank1.xsb");
            Components.Add(this.soundManager);

            //Menu
            this.menuManager = new MenuManager(this, this.inputManagerParameters,
                                               this.cameraManager, this.spriteBatch, this.eventDispatcher,
                                               StatusType.Off);
            Components.Add(this.menuManager);


            int scale = 1250;

            InitializeGround(scale);
            InitializeSkyBox(scale);
            InitializeTorusDecorator();
            InitializeSemiTransparentDecorators();
            InitializeDrivableObject();
            InitialiseDecoratorClones();

            InitializeCameras(ScreenLayoutType.Pip);

            InitializeMainMenu();
            InitializeOptionMenu();
            this.menuManager.SetActiveMenu(AppData.MenuMainID);
            //since debug needs sprite batch then call here
            InitializeDebug(true);

            base.Initialize();
        }