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); }
public Alert(Rectangle rectangle, Texture2D texture, String text, String method, Object[] param) : base(rectangle, texture) { //fuente font = Fonts.arial_12; //posicionamiento del alert. alertPos = new Vector2( PaintToWinUtils.centerArea(new Vector2(0, Globals.gameSize.X), new Vector2(0, rectangle.Width)), PaintToWinUtils.centerArea(new Vector2(0, Globals.gameSize.Y), new Vector2(0, rectangle.Height))); //texto y posicionamiento del texto del alert. this.text = text; textPos = new Vector2( PaintToWinUtils.centerTextX(new Vector2(alertPos.X, alertPos.X + rectangle.Width), Fonts.arial_12, text), PaintToWinUtils.centerTextY(new Vector2(alertPos.Y, alertPos.Y + rectangle.Height), Fonts.arial_12, text)); //tamaño, posicionamiento y creacion 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); button = new Button <T>(new Rectangle((int)buttonPos.X, (int)buttonPos.Y, (int)buttonSize.X, (int)buttonSize.Y), texture, Textures.hoverButton, method, param, "optionsscreen_accept", true); }