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
Last revisionBoth sides next revision
functions:hudlib [2016/08/10 13:23] – [HudSetShowToEveryone] korshunfunctions:hudlib [2016/10/16 13:29] – [Hudlib] korshun
Line 7: Line 7:
 Only drawing functions actually draw stuff. All other functions only manipulate render state. Only drawing functions actually draw stuff. All other functions only manipulate render state.
  
-Only drawing functions change ZDoom's global message settings[[zdoom>SetHudSize]] and [[zdoom>SetFont]].+Drawing functions change ZDoom's global message settings ([[zdoom>SetHudSize]] and [[zdoom>SetFont]]) every time they are calledOther functions do not touch them. 
 + 
 +===== 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 34: Line 51:
  
 Controls whether the statusbar area should be included into the virtual screen. This corresponds to the third parameter of ''[[zdoom>SetHudSize]]'' Controls whether the statusbar area should be included into the virtual screen. This corresponds to the third parameter of ''[[zdoom>SetHudSize]]''
 +
 +===== Widescreen support =====
 +
 +==== Hud boundaries ====
 +''fixed HudLeft()''
 +
 +''fixed HudRight()''
 +
 +''fixed HudTop()''
 +
 +''fixed HudBottom()''
 +
 +Return the boundaries of the screen for current virtual screen size, accounting for current **physical** aspect ratio. Equivalent to adding or subtracting a hud border manually.
 +
 +**Example**
 +
 +<code>
 +// This message will stick to the left border of the screen (with a gap), even in widescren.
 +HudSetPoint(HudLeft() + 3.0, 240.0);
 +</code>
 +
 +==== Hud borders ====
 +''fixed HudBorderX()''
 +
 +''fixed HudBorderY()''
 +
 +Return hud borders for current virtual screen size, accounting for current **physical** aspect ratio.
  
 ===== 2D positioning ===== ===== 2D positioning =====