/// <summary> /// Draw the wing slot backgrounds. /// </summary> private void Slot_DrawBackground(UIObject sender, SpriteBatch spriteBatch) { UIItemSlot slot = (UIItemSlot)sender; if (ShouldDrawSlots()) { slot.OnDrawBackground(spriteBatch); if (slot.Item.stack == 0) { Texture2D tex = mod.GetTexture(WingSlot.WingSlotBackTex); Vector2 origin = tex.Size() / 2f * Main.inventoryScale; Vector2 position = slot.Rectangle.TopLeft(); spriteBatch.Draw( tex, position + (slot.Rectangle.Size() / 2f) - (origin / 2f), null, Color.White * 0.35f, 0f, origin, Main.inventoryScale, SpriteEffects.None, 0f); // layer depth 0 = front } } }
/// <summary> /// Draw the wing dye slot background. /// </summary> private void WingDyeSlot_DrawBackground(UIObject sender, SpriteBatch spriteBatch) { UIItemSlot slot = (UIItemSlot)sender; if (ShouldDrawSlots()) { slot.OnDrawBackground(spriteBatch); if (slot.Item.stack == 0) { Texture2D tex = Main.extraTexture[54]; Rectangle rectangle = tex.Frame(3, 6, 1 % 3, 1 / 3); rectangle.Width -= 2; rectangle.Height -= 2; Vector2 origin = rectangle.Size() / 2f * Main.inventoryScale; Vector2 position = slot.Rectangle.TopLeft(); spriteBatch.Draw( tex, position + (slot.Rectangle.Size() / 2f) - (origin / 2f), new Rectangle?(rectangle), Color.White * 0.35f, 0f, origin, Main.inventoryScale, SpriteEffects.None, 0f); // layer depth 0 = front } } }