DRLA-RPG/ZScript/Events/HUDHandler.zs

30 lines
847 B
Plaintext
Raw Normal View History

2019-04-06 23:12:47 -07:00
class RLHUDHandler : StaticEventHandler;
ui Vector2 Size;
override void RenderOverlay(RenderEvent e)
{
RLBasePlayer cam = RLBasePlayer(e.Camera);
Size = (320, 240);
if (cam)
DrawMedikit(RLBasePlayer(Players[ConsolePlayer].MO));
}
ui void DrawMedikit(RLBasePlayer player)
{
DrawTexture("MEDIA0", 0, 20);
DrawBigText(string.Format("%d", player.Medikit), "Brick", 16, 16);
}
ui void DrawBigText(string text, Color color, float x, float y) const
{
Screen.DrawText(Font.FindFont("BIGFONT"), color, x, y, text, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y));
}
ui void DrawTexture(string texture, float x, float y) const
{
Screen.DrawTexture(TexMan.CheckForTexture(texture, TexMan.Type_Any), true, x, y, DTA_VirtualWidth, int(Size.X), DTA_VirtualHeight, int(Size.Y), DTA_CenterOffset, true);
}