ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:hudlib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
functions:hudlib [2016/08/08 21:23] korshunfunctions:hudlib [2016/08/10 15:28] korshun
Line 8: Line 8:
  
 Only drawing functions change ZDoom's global message settings: [[zdoom>SetHudSize]] and [[zdoom>SetFont]]. Only drawing functions change ZDoom's global message settings: [[zdoom>SetHudSize]] and [[zdoom>SetFont]].
 +
 +===== Examples =====
 +
 +==== Simple 2D drawing ====
 +
 +<code>
 +HudSetPoint(320.0, 240.0);
 +HudDrawText(1, "Hello!");
 +</code>
 +
 +==== Simple 3D drawing ====
 +
 +<code>
 +HudSetCameraActor(0);
 +HudSetPoint3D(0.0, 0.0, 0.0);
 +HudDrawText(2, "This is the center of the map!");
 +</code>
  
 ===== Virtual screen size ===== ===== Virtual screen size =====
Line 18: Line 35:
 ''void HudSetVirtualSize(fixed width, fixed height)'' ''void HudSetVirtualSize(fixed width, fixed height)''
  
-Sets the virtual screen size to the given dimensions. The default size is 640x480. This works exactly like ''SetHudSize''.+Sets the virtual screen size to the given dimensions. The default size is 640x480. This works exactly like ''[[zdoom>SetHudSize]]''.
  
 ==== HudUseRealSize ==== ==== HudUseRealSize ====
Line 210: Line 227:
 ''void HudSetShowToEveryone(bool showToEveryone)'' ''void HudSetShowToEveryone(bool showToEveryone)''
  
-If set to true, the message will be shown to everyone, and not just to the activator. This settings toggles between ''[[zdoom>HudMessage]]'' and ''[[zdoom>HudMessageBold]]'' in hudlib.+If set to true, the message will be shown to everyone, and not just to the activator. This setting toggles between ''[[zdoom>HudMessage]]'' and ''[[zdoom>HudMessageBold]]'' in hudlib.
  
 ==== HudSetLayer ==== ==== HudSetLayer ====
Line 255: Line 272:
  
 Default: (0, 0). Default: (0, 0).
 +
 +<note important>Remember that actor pitch in ZDoom is inverted.</note>
 +
 +<note tip>If you want to do ''HudSetCameraAngles(GetActorAngle(tid), -GetActorPitch(tid))'', use ''HudSetCameraActor(tid)'' instead.</note>
  
 ==== HudSetCameraActor ==== ==== HudSetCameraActor ====
Line 339: Line 360:
 Saves the current render state to a stack. Saves the current render state to a stack.
  
-<note important>There is a limit on how many states can be saved. If you save too many states, you will be notified through [[.error|the error system]].</note>+<note important>There is a limit on how many states can be saved. If you save more than ''ACSUTILS_HUDLIB_SAVEDSTATES'' states, you will be notified through [[.error|the error system]].</note>
 ==== HudPopState ==== ==== HudPopState ====
 ''void HudPopState()'' ''void HudPopState()''