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

◆ DrawCameraLock()

void Terraria.Graphics.Capture.CaptureInterface.DrawCameraLock ( SpriteBatch sb)
inlineprivate

Definition at line 1515 of file CaptureInterface.cs.

1516 {
1517 if (CameraFrame == 0f)
1518 {
1519 return;
1520 }
1521 sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Rectangle(0, 0, 1, 1), Color.Black * (CameraFrame / 5f));
1522 if (CameraFrame != 5f)
1523 {
1524 return;
1525 }
1526 float num = CameraWaiting - 60f + 5f;
1527 if (!(num <= 0f))
1528 {
1529 num /= 5f;
1530 float num2 = CaptureManager.Instance.GetProgress() * 100f;
1531 if (num2 > 100f)
1532 {
1533 num2 = 100f;
1534 }
1535 string text = num2.ToString("##") + " ";
1536 string text2 = "/ 100%";
1537 Vector2 vector = FontAssets.DeathText.Value.MeasureString(text);
1538 Vector2 vector2 = FontAssets.DeathText.Value.MeasureString(text2);
1539 Vector2 vector3 = new Vector2(0f - vector.X, (0f - vector.Y) / 2f);
1540 Vector2 vector4 = new Vector2(0f, (0f - vector2.Y) / 2f);
1541 ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.DeathText.Value, text, new Vector2(Main.screenWidth, Main.screenHeight) / 2f + vector3, Color.White * num, 0f, Vector2.Zero, Vector2.One);
1542 ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.DeathText.Value, text2, new Vector2(Main.screenWidth, Main.screenHeight) / 2f + vector4, Color.White * num, 0f, Vector2.Zero, Vector2.One);
1543 }
1544 }
void Draw(Texture2D texture, Vector2 position, Color color)
static Asset< DynamicSpriteFont > DeathText
Definition FontAssets.cs:12
static Asset< Texture2D > MagicPixel
static Vector2 DrawColorCodedStringWithShadow(SpriteBatch spriteBatch, DynamicSpriteFont font, TextSnippet[] snippets, Vector2 position, float rotation, Vector2 origin, Vector2 baseScale, out int hoveredSnippet, float maxWidth=-1f, float spread=2f)

References Microsoft.Xna.Framework.Color.Black, Terraria.Graphics.Capture.CaptureInterface.CameraFrame, Terraria.Graphics.Capture.CaptureInterface.CameraWaiting, Terraria.GameContent.FontAssets.DeathText, Microsoft.Xna.Framework.Graphics.SpriteBatch.Draw(), Terraria.UI.Chat.ChatManager.DrawColorCodedStringWithShadow(), Terraria.Graphics.Capture.CaptureManager.Instance, Terraria.GameContent.TextureAssets.MagicPixel, Microsoft.Xna.Framework.Vector2.One, Terraria.Main.screenHeight, Terraria.Main.screenWidth, System.text, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Graphics.Capture.CaptureInterface.Draw().