Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SpawnMapLayer.cs
Go to the documentation of this file.
4using Terraria.UI;
5
6namespace Terraria.Map;
7
8public class SpawnMapLayer : IMapLayer
9{
10 public void Draw(ref MapOverlayDrawContext context, ref string text)
11 {
12 Player localPlayer = Main.LocalPlayer;
13 Vector2 position = new Vector2(localPlayer.SpawnX, localPlayer.SpawnY);
14 if (context.Draw(position: new Vector2(Main.spawnTileX, Main.spawnTileY), texture: TextureAssets.SpawnPoint.Value, alignment: Alignment.Bottom).IsMouseOver)
15 {
16 text = Language.GetTextValue("UI.SpawnPoint");
17 }
18 if (localPlayer.SpawnX != -1 && context.Draw(TextureAssets.SpawnBed.Value, position, Alignment.Bottom).IsMouseOver)
19 {
20 text = Language.GetTextValue("UI.SpawnBed");
21 }
22 }
23}
static Asset< Texture2D > SpawnPoint
static Asset< Texture2D > SpawnBed
static string GetTextValue(string key)
Definition Language.cs:15
static int spawnTileY
Definition Main.cs:1811
static int spawnTileX
Definition Main.cs:1809
static Player LocalPlayer
Definition Main.cs:2829
void Draw(ref MapOverlayDrawContext context, ref string text)
static readonly Alignment Bottom
Definition Alignment.cs:21