Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawSelf()

override void Terraria.GameContent.UI.Elements.UIToggleImage.DrawSelf ( SpriteBatch spriteBatch)
inlineprotectedvirtual

Reimplemented from Terraria.UI.UIElement.

Definition at line 38 of file UIToggleImage.cs.

39 {
40 CalculatedStyle dimensions = GetDimensions();
42 Point point;
43 if (_isOn)
44 {
46 point = _onTextureOffset;
47 }
48 else
49 {
51 point = _offTextureOffset;
52 }
53 Color color = (base.IsMouseHovering ? Color.White : Color.Silver);
54 spriteBatch.Draw(value, new Rectangle((int)dimensions.X, (int)dimensions.Y, _drawWidth, _drawHeight), new Rectangle(point.X, point.Y, _drawWidth, _drawHeight), color);
55 }
void Draw(Texture2D texture, Vector2 position, Color color)
CalculatedStyle GetDimensions()
Definition UIElement.cs:382

References Terraria.GameContent.UI.Elements.UIToggleImage._drawHeight, Terraria.GameContent.UI.Elements.UIToggleImage._drawWidth, Terraria.GameContent.UI.Elements.UIToggleImage._isOn, Terraria.GameContent.UI.Elements.UIToggleImage._offTexture, Terraria.GameContent.UI.Elements.UIToggleImage._offTextureOffset, Terraria.GameContent.UI.Elements.UIToggleImage._onTexture, Terraria.GameContent.UI.Elements.UIToggleImage._onTextureOffset, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.UI.UIElement.GetDimensions(), Microsoft.Xna.Framework.Color.Silver, ReLogic.Content.Asset< T >.Value, Microsoft.Xna.Framework.Point.X, Terraria.UI.CalculatedStyle.X, Microsoft.Xna.Framework.Point.Y, and Terraria.UI.CalculatedStyle.Y.