protected override void DrawSelf(SpriteBatch sb) { CalculatedStyle innerDimension = GetInnerDimensions(); if (WithBox) { Drawing.DrawAdvBox(sb, (int)innerDimension.X, (int)innerDimension.Y, (int)innerDimension.Width, (int)innerDimension.Height, _currentColor, Drawing.Box1, new Vector2(10, 10)); } else { if (Texture != null) { sb.Draw(Texture, innerDimension.ToRectangle(), _currentColor); } } if (ButtonText != "") { Vector2 txtMeasure = Main.fontMouseText.MeasureString(ButtonText); Terraria.Utils.DrawBorderStringFourWay(sb, Main.fontMouseText, ButtonText, innerDimension.Center().X - txtMeasure.X / 2, innerDimension.Center().Y - txtMeasure.Y / 2, ButtonTextColor, Color.Black, Vector2.Zero); } }
protected override void DrawSelf(SpriteBatch sb) { CalculatedStyle innerDimension = GetInnerDimensions(); if (Texture != null) { sb.Draw(Texture, innerDimension.Center(), SourceRect, ButtonDefaultColor, 0f, Texture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); } }
protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = GetDimensions(); spriteBatch.Draw(Main.inventoryBackTexture, dimensions.Position(), Color.White * 0.6f); if (Item != null && Item.modItem != null) { Texture2D tex = ModContent.GetTexture(Item.modItem.Texture); spriteBatch.Draw(tex, dimensions.Center() - (tex.Size() * 0.75f), Color.White); } }
protected override void DrawSelf(SpriteBatch spriteBatch) { base.DrawSelf(spriteBatch); CalculatedStyle dimensions = GetDimensions(); Vector2 drawOrigin = _itemTexture.Size() * .5f; spriteBatch.Draw(_slotTexture, dimensions.ToRectangle(), null, Color.White); if (_hasItem()) { spriteBatch.Draw(_itemTexture, dimensions.Center() - _itemTexture.Size() * .5f, null, Color.White); } }
protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = GetDimensions(); bool unlockState = _entry.Icon.GetUnlockState(_collectionInfo); bool isHovered = base.IsMouseHovering || ForceHover; if (unlockState) { _entry.Icon.Draw(_collectionInfo, spriteBatch, new EntryIconDrawSettings { iconbox = dimensions.ToRectangle(), IsPortrait = _isPortrait, IsHovered = isHovered }); return; } Texture2D value = _notUnlockedTexture.get_Value(); spriteBatch.Draw(value, dimensions.Center(), null, Color.White * 0.15f, 0f, value.Size() / 2f, 1f, SpriteEffects.None, 0f); }
protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); int num = this._entry.Icon.GetUnlockState(this._collectionInfo) ? 1 : 0; bool flag = this.IsMouseHovering || this.ForceHover; if (num != 0) { this._entry.Icon.Draw(this._collectionInfo, spriteBatch, new EntryIconDrawSettings() { iconbox = dimensions.ToRectangle(), IsPortrait = this._isPortrait, IsHovered = flag }); } else { Texture2D texture2D = this._notUnlockedTexture.get_Value(); spriteBatch.Draw(texture2D, dimensions.Center(), new Rectangle?(), Color.White * 0.15f, 0.0f, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0.0f); } }
protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = base.GetDimensions(); Main.DrawItemIcon(spriteBatch, this._item, dimensions.Center(), Color.White * (IsMouseHovering ? 1 : 0.4f), 32f * _ItemScale); }
protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); Main.DrawItemIcon(spriteBatch, this._item, dimensions.Center(), this._blackedOut ? Color.Black : Color.White, 32f); }