Implements MonoGame specific engine
Inheritance: Engine
Esempio n. 1
0
 public void GraphicsDeviceCreated(GraphicsDevice graphicsDevice, Vector2 nativeSize)
 {
     // Unused variable must exist because of magic code happening in "new MonoGameEngine"
     Engine engine = new MonoGameEngine(
         graphicsDevice,
         (int)nativeSize.X,
         (int)nativeSize.Y);
 }
Esempio n. 2
0
        public MenuClass(GraphicsDeviceManager Graphics, GraphicsDevice device, ContentManager content, Game game, 
            EventHandler newgame, EventHandler exitgame)
        {

            this.device = device;
            graphics = Graphics;
            Content = content;
            Game = game;
            newGame = newgame;
            nativeScreenWidth = graphics.PreferredBackBufferWidth;
            nativeScreenHeight = graphics.PreferredBackBufferHeight;
            exitGame = exitgame;

            ServiceManager.Instance.AddService<IGameService>(new GameService(this));
            ServiceManager.Instance.AddService<ILocalizationService>(new LocalizationService());
            Engine engine = new MonoGameEngine(device, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
        }
Esempio n. 3
0
 void graphics_DeviceCreated(object sender, EventArgs e)
 {
     Engine engine = new MonoGameEngine(GraphicsDevice, nativeScreenWidth, nativeScreenHeight);
 }
Esempio n. 4
0
 private void Graphics_DeviceCreated(object sender, EventArgs e)
 {
     var Engine = new MonoGameEngine(GraphicsDevice, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight);
 }
Esempio n. 5
0
        public GUIManager(GraphicsDeviceManager graphics, ContentManager theContent, System.EventHandler gameExit,
            System.EventHandler returnToMenu, System.EventHandler gameSave, System.EventHandler gameLoad,
            System.EventHandler buildPressed, System.EventHandler zoomIn, System.EventHandler zoomOut,
            System.EventHandler gamePaused, System.EventHandler planetHighlighted, System.EventHandler comboboxToggled,
            System.EventHandler sectorChanged, System.EventHandler planetInfoPressed, SaveGameData Data,
            System.EventHandler systemSelected, System.EventHandler jumpToSystem, System.EventHandler jumpToPlanet,
            System.EventHandler TaxRateChanged, System.EventHandler GameSpeedChangedEvent, 
            System.EventHandler BuildingUpgradedEvent, System.EventHandler BuildingDismantledEvent,
            System.EventHandler ConstructBuildingEvent, System.EventHandler RemoveBuildQueueItemEvent, GraphicsDevice device)
        {
            this.Graphics = graphics;
            content = new ContentManager(theContent.ServiceProvider, theContent.RootDirectory);
            data = Data;
            Device = device;


            #region EventHandlers
            GameExit = gameExit;
            BuildPressed = buildPressed;
            GameSave = gameSave;
            GameLoad = gameLoad;
            ReturnToMenu = returnToMenu;
            ZoomIn = zoomIn;
            ZoomOut = zoomOut;
            GamePaused = gamePaused;
            PlanetHighlightedEvent = planetHighlighted;
            ComboboxToggled = comboboxToggled;
            SectorChanged = sectorChanged;
            PlanetInfoPressedEvent = planetInfoPressed;
            SystemSelected = systemSelected;
            systemJumpEvent = jumpToSystem;
            planetJumpEvent = jumpToPlanet;
            taxRateChanged = TaxRateChanged;
            gameSpeedChangedEvent = GameSpeedChangedEvent;
            buildingUpgradedEvent = BuildingUpgradedEvent;
            buildingDismantledEvent = BuildingDismantledEvent;
            constructBuildingEvent = ConstructBuildingEvent;
            removeBuildQueueItemEvent = RemoveBuildQueueItemEvent;
            #endregion

            #region Load Content

            cursor = content.Load<Texture2D>("cursor");
            //pp = graphics.GraphicsDevice.PresentationParameters;
            //renderTarget = new RenderTarget2D(graphics.GraphicsDevice,
            //                          pp.BackBufferWidth, pp.BackBufferHeight,
            //                          true, SurfaceFormat.Color, DepthFormat.None);

            Engine engine = new MonoGameEngine(Device, Graphics.PreferredBackBufferWidth, Graphics.PreferredBackBufferHeight);
            engine.InputDevice.MouseState.IsVisible = false;
            #endregion

            #region Assign Rectangles
            cursorRec = new Rectangle(0, 0, cursor.Width, cursor.Height);
            #endregion

            mouseScale = 0.5f;    //Scale of the mouse texture  
            moveEnabled = true;
        }