Exemplo n.º 1
0
        public void Draw(SpriteBatch spriteBatch, Vector2i pos, float deptLayer = 0.96f)
        {
            Position = pos;
            backdrop.Draw(spriteBatch, pos + new Vector2i(edgeLeft.getActiveButton().framesDimensions.X, edgeTop.getActiveButton().framesDimensions.Y - 2), deptLayer);
            edgeTop.Draw(spriteBatch, pos + new Vector2i(cornerLeft.getActiveButton().framesDimensions.X, 0), deptLayer);
            edgeLeft.Draw(spriteBatch, pos + new Vector2i(0, cornerLeft.getActiveButton().framesDimensions.Y), deptLayer);
            edgeRight.Draw(spriteBatch, pos + new Vector2i(size.X - edgeRight.getActiveButton().framesDimensions.X, cornerLeft.getActiveButton().framesDimensions.Y), deptLayer, SpriteEffects.FlipHorizontally);

            cornerLeft.Draw(spriteBatch, pos + new Vector2i(0, 0), deptLayer + 0.01f);
            cornerRight.Draw(spriteBatch, pos + new Vector2i(size.X - cornerRight.getActiveButton().framesDimensions.X, 0), deptLayer + 0.01f, SpriteEffects.FlipHorizontally);

            buttonName.Draw(spriteBatch, buttonName.GetPosition() + pos + new Vector2i(0, 0), deptLayer + 0.02f);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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;
        }