Ejemplo n.º 1
0
        public GuiManager(Game game, IServiceProvider serviceProvider, InputManager inputManager, IGuiRenderer guiRenderer, IOptionsProvider optionsProvider)
        {
            Game             = game;
            ServiceProvider  = serviceProvider;
            InputManager     = inputManager;
            ScaledResolution = new GuiScaledResolution(game)
            {
                GuiScale = optionsProvider.AlexOptions.VideoOptions.GuiScale
            };
            ScaledResolution.ScaleChanged += ScaledResolutionOnScaleChanged;

            FocusManager = new GuiFocusHelper(this, InputManager, game.GraphicsDevice);

            GuiRenderer = guiRenderer;
            guiRenderer.ScaledResolution = ScaledResolution;
            SpriteBatch = new SpriteBatch(Game.GraphicsDevice);

            GuiSpriteBatch = new GuiSpriteBatch(guiRenderer, Game.GraphicsDevice, SpriteBatch);
            GuiRenderArgs  = new GuiRenderArgs(Game.GraphicsDevice, SpriteBatch, ScaledResolution, GuiRenderer, new GameTime());

            //  DebugHelper = new GuiDebugHelper(this);

            optionsProvider.AlexOptions.VideoOptions.GuiScale.Bind((value, newValue) =>
            {
                ScaledResolution.GuiScale = newValue;
            });
        }
Ejemplo n.º 2
0
        public GuiManager(Game game, InputManager inputManager, IGuiRenderer guiRenderer)
        {
            Game             = game;
            InputManager     = inputManager;
            ScaledResolution = new GuiScaledResolution(game);
            ScaledResolution.ScaleChanged += ScaledResolutionOnScaleChanged;

            FocusManager = new GuiFocusHelper(this, InputManager, game.GraphicsDevice);

            GuiRenderer = guiRenderer;
            guiRenderer.ScaledResolution = ScaledResolution;
            SpriteBatch = new SpriteBatch(Game.GraphicsDevice);

            GuiSpriteBatch = new GuiSpriteBatch(guiRenderer, Game.GraphicsDevice, SpriteBatch);
            GuiRenderArgs  = new GuiRenderArgs(Game.GraphicsDevice, SpriteBatch, ScaledResolution, GuiRenderer, new GameTime());

            //  DebugHelper = new GuiDebugHelper(this);
        }