public InMenuButton(ContentManager content, int width, MyAction action, string text = "button.name.notfound") { useLanguage = true; actionStored = action; this.size = new Vector2i(width, 30); this.Position = new Vector2i(0, 0); buttonName = new Font(content, "Fonts/InMenuButton", text, Color.Black); cornerLeft = new ToggleHoverButton(content, new Vector2i(6, 6), new ToggleHoverButtonData("Menu/Navigator/Button/Corner", action, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); cornerRight = new ToggleHoverButton(content, new Vector2i(6, 6), new ToggleHoverButtonData("Menu/Navigator/Button/Corner", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); edgeTop = new ToggleHoverButton(content, new Vector2i(size.X - cornerLeft.getActiveButton().framesDimensions.X * 2, 5), new ToggleHoverButtonData("Menu/Navigator/Button/edgeTop", () => { }, new Vector2(0, 0), new Vector2i(1, 3), Color.White)); edgeLeft = new ToggleHoverButton(content, new Vector2i(4, size.Y - cornerLeft.getActiveButton().framesDimensions.Y), new ToggleHoverButtonData("Menu/Navigator/Button/edgeSide", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); edgeRight = new ToggleHoverButton(content, new Vector2i(4, size.Y - cornerRight.getActiveButton().framesDimensions.Y), new ToggleHoverButtonData("Menu/Navigator/Button/edgeSide", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); backdrop = new ToggleHoverButton(content, new Vector2i(size.X - edgeLeft.getActiveButton().framesDimensions.X * 2, 27), new ToggleHoverButtonData("Menu/Navigator/Button/Backdrop", () => { }, new Vector2(0, 0), new Vector2i(1, 3), Color.White)); }
public InMenuButton(InMenuButton imb) { this.size = new Vector2i(imb.size.X, imb.size.Y); this.Position = new Vector2i(imb.Position.X, imb.Position.Y); this.buttonName = imb.buttonName.Clone() as Font; ContentManager content = GameScreenManager.Instance.GetContentManager(); cornerLeft = new ToggleHoverButton(content, new Vector2i(6, 6), new ToggleHoverButtonData("Menu/Navigator/Button/Corner", imb.actionStored, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); cornerRight = new ToggleHoverButton(content, new Vector2i(6, 6), new ToggleHoverButtonData("Menu/Navigator/Button/Corner", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); edgeTop = new ToggleHoverButton(content, new Vector2i(size.X - cornerLeft.getActiveButton().framesDimensions.X * 2, 5), new ToggleHoverButtonData("Menu/Navigator/Button/edgeTop", () => { }, new Vector2(0, 0), new Vector2i(1, 3), Color.White)); edgeLeft = new ToggleHoverButton(content, new Vector2i(4, size.Y - cornerLeft.getActiveButton().framesDimensions.Y), new ToggleHoverButtonData("Menu/Navigator/Button/edgeSide", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); edgeRight = new ToggleHoverButton(content, new Vector2i(4, size.Y - cornerRight.getActiveButton().framesDimensions.Y), new ToggleHoverButtonData("Menu/Navigator/Button/edgeSide", () => { }, new Vector2(0, 0), new Vector2i(3, 1), Color.White)); backdrop = new ToggleHoverButton(content, new Vector2i(size.X - edgeLeft.getActiveButton().framesDimensions.X * 2, 27), new ToggleHoverButtonData("Menu/Navigator/Button/Backdrop", () => { }, new Vector2(0, 0), new Vector2i(1, 3), Color.White)); //this.edgeBottom = imb.edgeBottom.Clone() as ToggleHoverButton; this.useLanguage = imb.useLanguage; }
public ToggleHoverButton(ToggleHoverButton thvb) { buttons = new List <HoverButton>(); data = new List <ToggleHoverButtonData>(); this.size = new Vector2i(thvb.size.X, thvb.size.Y); originalSize = new Vector2i(thvb.originalSize.X, thvb.originalSize.Y); foreach (ToggleHoverButtonData dataItem in thvb.data) { data.Add(dataItem); } foreach (HoverButton dataItem in thvb.buttons) { buttons.Add(dataItem); } timer = new Timer(200); timer.Elapsed += new ElapsedEventHandler(timer_reset); }