コード例 #1
0
        public PanelButton createPanelButton(SpriteFont pFont, string pText, Vector2 pPosition, string pAction, string pOrigin, bool pIsInteractable, Texture2D pTexture, Texture2D pOtherTexture, float pScale)
        {
            PanelButton newPanelButton = new PanelButton(pFont, pText, pPosition, pAction, Color.White, pOrigin, pIsInteractable, pTexture, pOtherTexture, pScale);

            list_panelButtons.Add(newPanelButton);

            return(newPanelButton);
        }
コード例 #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);
        }