Esempio n. 1
0
        protected override void LoadContent()
        {
            base.LoadContent();
            StaticServiceLocator.AddService(GraphicsDevice);
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, ScreenSize.Width, ScreenSize.Height);

            _rpgScene = new TopDownRpgScene(viewportAdapter, _spriteBatch);
            StaticServiceLocator.AddService(viewportAdapter);
            var screens = new List <Screen>
            {
                new MainMenuScreen(viewportAdapter, Services, this),
                new LoadGameScreen(viewportAdapter, Services),
                new OptionsScreen(viewportAdapter, Services),
                new AudioOptionsScreen(viewportAdapter, Services),
                new VideoOptionsScreen(viewportAdapter, Services),
                new KeyboardOptionsScreen(viewportAdapter, Services),
                new MouseOptionsScreen(viewportAdapter, Services),
                new HelpScreen(viewportAdapter, Services),
                _rpgScene
            };

            foreach (var screen in screens)
            {
                screen.LoadContent();
                _screenComponent.Register(screen);
            }
        }
Esempio n. 2
0
        public Game1()
        {
            _graphicsDeviceManager   = new GraphicsDeviceManager(this);
            Content.RootDirectory    = "Content";
            IsMouseVisible           = true;
            Window.AllowUserResizing = true;

            ScreenComponent screenComponent;

            Components.Add(screenComponent = new ScreenComponent(this));

            screenComponent.Register(new MainMenuScreen(Services, this));
            screenComponent.Register(new LoadGameScreen(Services));
            screenComponent.Register(new OptionsScreen(Services));
            screenComponent.Register(new AudioOptionsScreen(Services));
            screenComponent.Register(new VideoOptionsScreen(Services));
            screenComponent.Register(new KeyboardOptionsScreen(Services));
            screenComponent.Register(new MouseOptionsScreen(Services));
        }