Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ DrawNPCDirect_QueenSlimeWings()

void Terraria.Main.DrawNPCDirect_QueenSlimeWings ( NPC rCurrentNPC,
SpriteBatch mySpriteBatch,
Vector2 screenPos,
Vector2 drawCenter,
Microsoft::Xna::Framework::Color originColor )
inline

Definition at line 20963 of file Main.cs.

20964 {
20965 Texture2D value = TextureAssets.Extra[185].Value;
20966 Microsoft.Xna.Framework.Rectangle rectangle = value.Frame(1, 4, 0, (int)rCurrentNPC.localAI[3] / 6);
20967 float scale = 0.8f;
20968 for (int i = 0; i < 2; i++)
20969 {
20970 float x = 1f;
20971 float num = 0f;
20972 SpriteEffects effects = SpriteEffects.None;
20973 if (i == 1)
20974 {
20975 x = 0f;
20976 num = 0f - num + 2f;
20977 effects = SpriteEffects.FlipHorizontally;
20978 }
20979 Vector2 origin = rectangle.Size() * new Vector2(x, 0.5f);
20980 Vector2 vector = new Vector2(drawCenter.X + num, drawCenter.Y);
20981 if (rCurrentNPC.rotation != 0f)
20982 {
20983 vector = vector.RotatedBy(rCurrentNPC.rotation, rCurrentNPC.Bottom);
20984 }
20985 vector -= screenPos;
20986 float num2 = MathHelper.Clamp(rCurrentNPC.velocity.Y, -6f, 6f) * -0.1f;
20987 if (i == 0)
20988 {
20989 num2 *= -1f;
20990 }
20991 mySpriteBatch.Draw(value, vector, rectangle, originColor, rCurrentNPC.rotation + num2, origin, scale, effects, 0f);
20992 }
20993 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static Asset< Texture2D >[] Extra

References Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.GameContent.TextureAssets.Extra, System.Text.RegularExpressions.i, System.value, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Main.DrawNPCDirect().