コード例 #1
0
ファイル: MarketScreen.cs プロジェクト: Neojate/Paintball
        public MarketScreen(Player p)
        {
            Name  = "MarketScreen";
            State = ScreenState.Active;

            //Player
            player = p;

            //Filas y columnas
            columns = new float[] { Globals.gameSize.X * 0.1f, Globals.gameSize.X * 0.352f, Globals.gameSize.X * 0.4f, Globals.gameSize.X * 0.65f, Globals.gameSize.X * 0.7f };
            rows    = new float[] { Globals.gameSize.Y * 0.1f, Globals.gameSize.Y * 0.18f, Globals.gameSize.Y * 0.26f, Globals.gameSize.Y * 0.34f, Globals.gameSize.Y * 0.42f, Globals.gameSize.Y * 0.5f, Globals.gameSize.Y * 0.7f };

            //Marcadoras
            getMarkers();

            //Botón
            tabBtnSize = new Vector2(Globals.gameSize.X * 0.25f, Globals.gameSize.Y * 0.08f);
            buttonSize = new Vector2(Globals.gameSize.X * 0.16f, Globals.gameSize.Y * 0.08f);

            //Equipo
            baseEquip = markers[0];

            //Creación de la interfaz
            createInterface();

            //Fisicas
            haveChange = true;
        }
コード例 #2
0
        public buyAlert(Rectangle rectangle, Texture2D texture, BaseEquip equip, String method, Object[] param) : base(rectangle, texture)
        {
            //fuente
            font = Fonts.arial_12;

            //Language
            language = new Language();

            //Equipo
            this.equip = equip;

            //Filas y columnas
            columns = new float[] { Globals.gameSize.X * 0.31f, Globals.gameSize.X * 0.62f };
            rows    = new float[] { Globals.gameSize.Y * 0.35f, Globals.gameSize.Y * 0.4f, Globals.gameSize.Y * 0.7f };

            //posicionamiento del alert.
            alertPos = new Vector2(
                PaintToWinUtils.centerArea(new Vector2(rectangle.X, Globals.gameSize.X), new Vector2(0, rectangle.Width)),
                PaintToWinUtils.centerArea(new Vector2(rectangle.Y, Globals.gameSize.Y), new Vector2(0, rectangle.Height)));

            //tamaño, posicionamiento y creación del boton.
            buttonSize = new Vector2(150, 30);
            Vector2 buttonPos = new Vector2(
                PaintToWinUtils.centerArea(new Vector2(alertPos.X, alertPos.X + rectangle.Width), new Vector2(0, buttonSize.X)),
                rectangle.Height * 0.75f + alertPos.Y);

            acceptButton = new Button <T>(new Rectangle((int)(buttonPos.X - Globals.gameSize.X * 0.1f), (int)buttonPos.Y, (int)buttonSize.X, (int)buttonSize.Y), texture, Textures.hoverButton, method, param, "gameMenuMarket_buy", true);
            cancelButton = new Button <T>(new Rectangle((int)(buttonPos.X + Globals.gameSize.X * 0.1f), (int)buttonPos.Y, (int)buttonSize.X, (int)buttonSize.Y), texture, Textures.hoverButton, method, param, "optionsscreen_exit", true);
        }
コード例 #3
0
ファイル: MarketScreen.cs プロジェクト: Neojate/Paintball
 /** Actualiza la información de la marcadora actual */
 /** equip = marcadora actual */
 public static void weaponInfo(BaseEquip equip)
 {
     haveChange = true;
     baseEquip  = equip;
 }