public UIPartSelector(BaseMenu menu, Point position) : base(menu, null, new Rectangle(position.X, position.Y, 0, 0)) { TypeBar = new UIStandardButton(menu, new Point(position.X, position.Y), "Nose"); TypeBar.ForcedLength = (int)Resources.Menus.ButtonFont.MeasureString("012345").X; TypeBar.dimensions = new Rectangle(position.X, position.Y, TypeBar.ForcedLength + 36 * 2, 48); int x = TypeBar.dimensions.X + TypeBar.dimensions.Width - 24; NameBar = new UIStandardButton(menu, new Point(x, position.Y), "No Part"); NameBar.ForcedLength = nameLength; NameBar.isDisplay = true; NameBar.dimensions = new Rectangle(x, position.Y, NameBar.ForcedLength + 36 * 2, 48); menu.Manager.Elements.Add(NameBar); /*tex = Resources.Menus.Customization.DescriptionScreen; * dim = new Rectangle((weaponNameBar.dimensions.X+weaponNameBar.dimensions.Width)-tex.Width, position.Y + weaponGraphicBox.dimensions.Height + 8, tex.Width, tex.Height); * weaponDescriptionBox = new UIElement(menu, tex, dim);*/ Texture2D tex = Resources.Menus.Customization.UpArrow; Rectangle dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y - 6, tex.Width, tex.Height); UpArrow = new UIElement(menu, tex, dim); tex = Resources.Menus.Customization.DownArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y + dim.Height + 8, tex.Width, tex.Height); DownArrow = new UIElement(menu, tex, dim); menu.Manager.Elements.Add(UpArrow); menu.Manager.Elements.Add(DownArrow); }
public UIWeaponSelector(BaseMenu menu, Point position) : base(menu, null, new Rectangle(position.X, position.Y, 0, 0)) { Texture2D tex = Resources.Menus.Customization.WeaponSelector; Rectangle dim = new Rectangle(position.X, position.Y, tex.Width, tex.Height); graphicBox = new UIElement(menu, tex, dim); tex = Resources.Menus.HUD.WeaponIcon[0]; dim = new Rectangle(dim.X + (dim.Width / 2 - tex.Width / 2), dim.Y + (dim.Height / 2 - tex.Height / 2), tex.Width, tex.Height); graphic = new UIElement(menu, tex, dim); int x = graphicBox.dimensions.X + graphicBox.dimensions.Width - 24; int y = 8; NameBar = new UIStandardButton(menu, new Point(x, position.Y+y), "No Weapon"); NameBar.ForcedLength = nameLength; NameBar.dimensions = new Rectangle(x, position.Y, NameBar.ForcedLength + 36 * 2, 48); NameBar.isDisplay = true; menu.Manager.Elements.Add(NameBar); /*tex = Resources.Menus.Customization.DescriptionScreen; dim = new Rectangle((weaponNameBar.dimensions.X+weaponNameBar.dimensions.Width)-tex.Width, position.Y + weaponGraphicBox.dimensions.Height + 8, tex.Width, tex.Height); weaponDescriptionBox = new UIElement(menu, tex, dim);*/ tex = Resources.Menus.Customization.UpArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y, tex.Width, tex.Height); UpArrow = new UIElement(menu, tex, dim); tex = Resources.Menus.Customization.DownArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y + dim.Height + 12, tex.Width, tex.Height); DownArrow = new UIElement(menu, tex, dim); menu.Manager.Elements.Add(UpArrow); menu.Manager.Elements.Add(DownArrow); menu.Manager.Elements.Add(graphicBox); Available = false; }
public UIPartSelector(BaseMenu menu, Point position) : base(menu, null, new Rectangle(position.X, position.Y, 0, 0)) { TypeBar = new UIStandardButton(menu, new Point(position.X,position.Y), "Nose"); TypeBar.ForcedLength = (int)Resources.Menus.ButtonFont.MeasureString("012345").X; TypeBar.dimensions = new Rectangle(position.X, position.Y, TypeBar.ForcedLength + 36 * 2, 48); int x = TypeBar.dimensions.X + TypeBar.dimensions.Width - 24; NameBar = new UIStandardButton(menu, new Point(x, position.Y), "No Part"); NameBar.ForcedLength = nameLength; NameBar.isDisplay = true; NameBar.dimensions = new Rectangle(x, position.Y, NameBar.ForcedLength + 36 * 2, 48); menu.Manager.Elements.Add(NameBar); /*tex = Resources.Menus.Customization.DescriptionScreen; dim = new Rectangle((weaponNameBar.dimensions.X+weaponNameBar.dimensions.Width)-tex.Width, position.Y + weaponGraphicBox.dimensions.Height + 8, tex.Width, tex.Height); weaponDescriptionBox = new UIElement(menu, tex, dim);*/ Texture2D tex = Resources.Menus.Customization.UpArrow; Rectangle dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y-6, tex.Width, tex.Height); UpArrow = new UIElement(menu, tex, dim); tex = Resources.Menus.Customization.DownArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y+dim.Height+8, tex.Width, tex.Height); DownArrow = new UIElement(menu, tex, dim); menu.Manager.Elements.Add(UpArrow); menu.Manager.Elements.Add(DownArrow); }
public override void Initialize() { viewport = MobileFortressClient.Game.GraphicsDevice.Viewport; Point loc = new Point(viewport.Width / 2 - 128, 32); OptionsTitle = new UIStandardButton(this, loc, "Options"); OptionsTitle.customFont = Resources.Menus.BaroqueScript16; Texture2D tex = Resources.Menus.Title.TextBox; loc = new Point(32, 128); Server = new UIStandardButton(this, loc, "Server Address"); Rectangle dim = new Rectangle(loc.X+Server.dimensions.Width+12,loc.Y+8,tex.Width,tex.Height); ServerAddress = new UITextBox(this, tex, dim, false); ServerAddress.Contents = Network.NetworkAddress; Manager.Elements.Add(ServerAddress); loc = new Point(32, 196); MouseSettings = new UIStandardButton(this, loc, "Mouse Sensitivity"); dim = new Rectangle(loc.X + MouseSettings.dimensions.Width + 12, loc.Y + 8, tex.Width/6, tex.Height); Sensitivity = new UITextBox(this, tex, dim, false); Sensitivity.Contents = (Controls.Instance.mouseSensitivityX / 0.015f).ToString(); Sensitivity.maxLength = 3; Manager.Elements.Add(Sensitivity); loc = new Point(32, viewport.Height - 64); Exit = new UIStandardButton(this, loc, "Exit"); Exit.hasButton = true; Exit.customFont = Resources.Menus.BaroqueScript16; Exit.Clicked += new UIElement.ClickEvent(Exit_Clicked); Manager.Elements.Add(Exit); pointerTex = Resources.Menus.Title.Pointer; pointerDim = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height); }
public override void Initialize() { viewport = MobileFortressClient.Game.GraphicsDevice.Viewport; Point loc = new Point(viewport.Width / 2 - 128, 32); OptionsTitle = new UIStandardButton(this, loc, "Options"); OptionsTitle.customFont = Resources.Menus.BaroqueScript16; Texture2D tex = Resources.Menus.Title.TextBox; loc = new Point(32, 128); Server = new UIStandardButton(this, loc, "Server Address"); Rectangle dim = new Rectangle(loc.X + Server.dimensions.Width + 12, loc.Y + 8, tex.Width, tex.Height); ServerAddress = new UITextBox(this, tex, dim, false); ServerAddress.Contents = Network.NetworkAddress; Manager.Elements.Add(ServerAddress); loc = new Point(32, 196); MouseSettings = new UIStandardButton(this, loc, "Mouse Sensitivity"); dim = new Rectangle(loc.X + MouseSettings.dimensions.Width + 12, loc.Y + 8, tex.Width / 6, tex.Height); Sensitivity = new UITextBox(this, tex, dim, false); Sensitivity.Contents = (Controls.Instance.mouseSensitivityX / 0.015f).ToString(); Sensitivity.maxLength = 3; Manager.Elements.Add(Sensitivity); loc = new Point(32, viewport.Height - 64); Exit = new UIStandardButton(this, loc, "Exit"); Exit.hasButton = true; Exit.customFont = Resources.Menus.BaroqueScript16; Exit.Clicked += new UIElement.ClickEvent(Exit_Clicked); Manager.Elements.Add(Exit); pointerTex = Resources.Menus.Title.Pointer; pointerDim = new Rectangle(0, 0, pointerTex.Width, pointerTex.Height); }
public UIWeaponSelector(BaseMenu menu, Point position) : base(menu, null, new Rectangle(position.X, position.Y, 0, 0)) { Texture2D tex = Resources.Menus.Customization.WeaponSelector; Rectangle dim = new Rectangle(position.X, position.Y, tex.Width, tex.Height); graphicBox = new UIElement(menu, tex, dim); tex = Resources.Menus.HUD.WeaponIcon[0]; dim = new Rectangle(dim.X + (dim.Width / 2 - tex.Width / 2), dim.Y + (dim.Height / 2 - tex.Height / 2), tex.Width, tex.Height); graphic = new UIElement(menu, tex, dim); int x = graphicBox.dimensions.X + graphicBox.dimensions.Width - 24; int y = 8; NameBar = new UIStandardButton(menu, new Point(x, position.Y + y), "No Weapon"); NameBar.ForcedLength = nameLength; NameBar.dimensions = new Rectangle(x, position.Y, NameBar.ForcedLength + 36 * 2, 48); NameBar.isDisplay = true; menu.Manager.Elements.Add(NameBar); /*tex = Resources.Menus.Customization.DescriptionScreen; * dim = new Rectangle((weaponNameBar.dimensions.X+weaponNameBar.dimensions.Width)-tex.Width, position.Y + weaponGraphicBox.dimensions.Height + 8, tex.Width, tex.Height); * weaponDescriptionBox = new UIElement(menu, tex, dim);*/ tex = Resources.Menus.Customization.UpArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y, tex.Width, tex.Height); UpArrow = new UIElement(menu, tex, dim); tex = Resources.Menus.Customization.DownArrow; dim = new Rectangle(NameBar.dimensions.X + (36 * 2 + NameBar.ForcedLength) - tex.Width , position.Y + dim.Height + 12, tex.Width, tex.Height); DownArrow = new UIElement(menu, tex, dim); menu.Manager.Elements.Add(UpArrow); menu.Manager.Elements.Add(DownArrow); menu.Manager.Elements.Add(graphicBox); Available = false; }