Esempio n. 1
0
        public PanelItem createPanelItem(SpriteBatch pSpriteBatch, Vector2 pPosition, string pText, string pAction, SpriteFont pFont, Size2 pSize, string pOrigin, bool pIsInteractable)
        {
            PanelItem newPanelItem = new PanelItem(pFont, pText, pPosition, pAction, new Color(0, 255, 0), pSize, pOrigin, pIsInteractable);

            list_clicableElements.Add(newPanelItem);
            return(newPanelItem);
        }
Esempio n. 2
0
        public void InitGameplayInterface()
        {
            //-- HUMANS COUNT
            Vector2 elementPosition;

            elementPosition  = new Vector2((GraphicsDevice.Viewport.Width / 3) + 5, panelHeight + 40);
            panel_textPlanet = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "PLANET INFO", "none", fontDefault, new Size2(3, 3), "default", false);

            elementPosition  = new Vector2(((GraphicsDevice.Viewport.Width / 3) * 2) + 5, panelHeight + 1);
            panel_textRocket = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "ROCKET INFO", "none", fontDefault, new Size2(3, 3), "default", false);


            elementPosition         = new Vector2((GraphicsDevice.Viewport.Width / 3) + 5, panelHeight + 1);
            panel_countHumans       = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, myGameState.count_humans.ToString() + " HUMANS", "none", fontDefault, new Size2(3, 3), "default", true);
            elementPosition         = new Vector2((GraphicsDevice.Viewport.Width / 3) + 5, panelHeight + 75);
            panel_planetName        = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "", "none", fontDefault, new Size2(3, 3), "default", true);
            elementPosition        += new Vector2(0, 35);
            panel_planetTemperature = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "", "none", fontDefault, new Size2(3, 3), "default", true);
            elementPosition         = new Vector2(30, panelHeight + 20);
            panel_fuelJauge         = myInterfaceManager.createPanelJauge(spriteBatch, img_jauge, Color.Black, elementPosition, 0, "default", 0.3f);
            elementPosition        += new Vector2(0, 90);
            panel_buttonRefuel      = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_switchOff, img_switchOn, 0.2f);
            elementPosition         = new Vector2(65, panelHeight + 20);
            panel_tempJauge         = myInterfaceManager.createPanelJauge(spriteBatch, img_jaugeInverted, Color.Red, elementPosition, myGameState.currentTemperature, "default", 0.3f);
            elementPosition        += new Vector2(0, 90);
            panel_buttonCool        = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_switchOff, img_switchOn, 0.2f);
            elementPosition         = new Vector2(100, panelHeight + 20);
            panel_oxyJauge          = myInterfaceManager.createPanelJauge(spriteBatch, img_jauge, Color.MediumSlateBlue, elementPosition, myGameState.currentOxygene, "default", 0.3f);
            elementPosition        += new Vector2(0, 90);
            panel_buttonOxygene     = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_switchOn, img_switchOff, 0.2f);

            elementPosition = new Vector2(elementPosition.X + 35, panelHeight + 110);
            panel_gpsLever  = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_switchOn, img_switchOff, 0.2f);

            elementPosition         = new Vector2(GraphicsDevice.Viewport.Width - GraphicsDevice.Viewport.Width / 3 - img_switchOn.Width * 0.2f - 58, panelHeight + 110);
            panel_buttonElectricity = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_switchOff, img_switchOn, 0.2f);

            elementPosition += new Vector2(30, -13);
            panel_lever      = myInterfaceManager.createPanelButton(fontDefault, "", elementPosition, "switch", "center", true, img_leverOff, img_leverOn, 0.3f);

            elementPosition      = new Vector2(((GraphicsDevice.Viewport.Width / 3) * 2) + 5, panelHeight + 40);
            panel_rocketAltitude = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "", "none", fontDefault, new Size2(3, 3), "default", true);

            elementPosition  = new Vector2(elementPosition.X, panelHeight + 75);
            panel_stabilized = myInterfaceManager.createPanelItem(spriteBatch, elementPosition, "", "none", fontDefault, new Size2(3, 3), "default", true);

            myRocket = new Rocket(defaultRocketPosition, img_rocket);
        }