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

◆ Draw() [5/7]

void Terraria.DataStructures.SpriteDrawBuffer.Draw ( Texture2D texture,
Vector2 position,
Rectangle? sourceRectangle,
VertexColors colors,
float rotation,
Vector2 origin,
Vector2 scale,
SpriteEffects effects )
inline

Definition at line 136 of file SpriteDrawBuffer.cs.

137 {
138 float z;
139 float w;
140 if (sourceRectangle.HasValue)
141 {
142 z = (float)sourceRectangle.Value.Width * scale.X;
143 w = (float)sourceRectangle.Value.Height * scale.Y;
144 }
145 else
146 {
147 z = (float)texture.Width * scale.X;
148 w = (float)texture.Height * scale.Y;
149 }
150 Draw(texture, new Vector4(position.X, position.Y, z, w), sourceRectangle, colors, rotation, origin, effects, 0f);
151 }

References Microsoft.Xna.Framework.Draw, Microsoft.Xna.Framework.Graphics.Texture2D.Height, Microsoft.Xna.Framework.Rectangle.Height, Microsoft.Xna.Framework.Graphics.Vector4, Microsoft.Xna.Framework.Graphics.Texture2D.Width, Microsoft.Xna.Framework.Rectangle.Width, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.