Example #1
0
        public override void Render(SpriteBatch b, int x, int y)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);

            Render2DUtils.DrawButton(b, x, y, Width, Height, Hovered ? Color.Wheat : Color.White);
            FontUtils.DrawHvCentered(b, $"{Title}:({Min}-{Max}){Current}", x + Width / 2, y + Height / 2);
        }
Example #2
0
        public override void Render(SpriteBatch b)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), X, Y, Width, Height);

            Render2DUtils.DrawButton(b, X, Y, Width, Height, Hovered ? Color.Wheat : Color.White);
            FontUtils.DrawHvCentered(b, Title, X + Width / 2, Y + Height / 2);
        }
Example #3
0
        public override void Render(SpriteBatch b)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), X, Y, Width, Height);

            for (int i = _index, j = 0;
                 j < (Entries.Count >= _maxEntry ? _maxEntry : Entries.Count);
                 i++, j++)
            {
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(384, 396, 15, 15), X,
                                              Y + j * SlotHeight, Width, SlotHeight, Color.Wheat, 4f, false);
                Entries[i].Width  = Width;
                Entries[i].Height = SlotHeight;
                var slotY = Y + j * SlotHeight;
                Entries[i].Render(b, X, slotY);
                if (Entries[i].Hovered)
                {
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(375, 357, 3, 3), X, slotY, Width, SlotHeight,
                                                  Color.Red, 4f, false);
                }

                if (Entries[i].Equals(SelectedEntry))
                {
                    IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(375, 357, 3, 3), X, slotY, Width, SlotHeight,
                                                  Color.Red, 4f, false);
                }

                if (Entries[i].Hovered && _mouseClicked)
                {
                    SelectedEntry = Entries[i];
                }
            }
        }
Example #4
0
            public override void Render(SpriteBatch b, int x, int y)
            {
                Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);
                FontUtils.Draw(b, ModInfo.Manifest.Name, x + 15, y + 10);
                var desc = Game1.parseText(ModInfo.Manifest.Description, Game1.smallFont, Width - 15).Split('\n')[0];

                Utility.drawTextWithShadow(b, desc, Game1.smallFont,
                                           new Vector2(x + 15, y + 10 + 30), Game1.textColor, 1f,
                                           -1f,
                                           -1, -1, 0.0f);
            }
Example #5
0
        public override void Render(SpriteBatch b, int x, int y)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);

            Render2DUtils.DrawButton(b, x, y, Width, Height, Hovered ? Color.Wheat : Color.White);
            FontUtils.DrawHvCentered(b, Title, x + Width / 2, y + Height / 2);
            if (!(Npc is Pet || Npc is Horse))
            {
                new ClickableTextureComponent("Mugshot", new Rectangle(x, y, Height, Height), "", "", Npc.Sprite.Texture,
                                              Npc.getMugShotSourceRect(), 0.7f * Game1.pixelZoom).draw(b);
            }
        }
Example #6
0
        public override void Render(SpriteBatch b, int x, int y)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);
            Render2DUtils.DrawButton(b, x, y, Width, Height, Color.Wheat);
            if (Hovered)
            {
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(375, 357, 3, 3), x, y, Width, Height,
                                              Color.Black, 4f, false);
            }

            FontUtils.DrawHvCentered(b, Title, x + Width / 2, y + Height / 2);
        }
Example #7
0
        public override void Render(SpriteBatch b)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), X, Y, Width, Height);

            Render2DUtils.DrawBound(b, X - 5, Y - 5, Width + 20, Height + 25, Color.White);

            if (!Hovered)
            {
                _textBox.Selected = false;
            }

            _textBox.Draw(b);
        }
Example #8
0
        public override void Render(SpriteBatch b)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), X, Y, Width, Height);

            Render2DUtils.DrawButton(b, X, Y, Width, Height, Hovered ? Color.Wheat : Color.White);
            FontUtils.DrawHvCentered(b, Title, X + Width / 2, Y + Height / 2);

            if (Hovered)
            {
                IClickableMenu.drawTextureBox(b, Game1.mouseCursors, new Rectangle(375, 357, 3, 3), X, Y, Width, Height,
                                              Color.Red, 4f, false);
            }
        }
        public override void Render(SpriteBatch b, int x, int y)
        {
            Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);

            Color color;

            if (Toggled)
            {
                color = Color.Green;
            }
            else
            {
                color = Color.Red;
            }

            if (Hovered)
            {
                color = Color.Wheat;
            }

            Render2DUtils.DrawButton(b, x, y, Width, Height, color);
            FontUtils.DrawHvCentered(b, Title, x + Width / 2, y + Height / 2);
        }
Example #10
0
 public override void Render(SpriteBatch b, int x, int y)
 {
     Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);
     FontUtils.DrawHvCentered(b, Title, x + Width / 2, y + Height / 2);
 }
Example #11
0
 public override void Render(SpriteBatch b, int x, int y)
 {
     Hovered = Render2DUtils.IsHovered(Game1.getMouseX(), Game1.getMouseY(), x, y, Width, Height);
     b.Draw(Game1.staminaRect, new Rectangle(x, y, Width, Height), Color);
     FontUtils.DrawHvCentered(b, Title, x + Width / 2, y + Height / 2);
 }