ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


hud_coordinate_system

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
hud_coordinate_system [2017/04/18 16:31] korshunhud_coordinate_system [2017/04/18 16:35] korshun
Line 1: Line 1:
 ====== HUD coordinate system ====== ====== HUD coordinate system ======
 ZDoom uses a special coordinate system for [[zdoom>HudMessage]]s. In 4:3 resolutions, the coordinate system's rectangle matches that of the screen. In aspect ratios other than that, a 4:3 rectangle is put at the center of the screen and the remaining screen space is out of its boundaries. ZDoom uses a special coordinate system for [[zdoom>HudMessage]]s. In 4:3 resolutions, the coordinate system's rectangle matches that of the screen. In aspect ratios other than that, a 4:3 rectangle is put at the center of the screen and the remaining screen space is out of its boundaries.
 +
 +The HUD coordinate system's rectangle width and height are specified in [[zdoom>SetHudSize]].
  
 ACSUtils provides functions to correctly work with the HUD coordinate system. ACSUtils provides functions to correctly work with the HUD coordinate system.
Line 7: Line 9:
 [[functions:GetAspectRatio]] returns the aspect ratio that ZDoom assumes the screen is. ZDoom uses tricky code for that. [[functions:GetAspectRatio]] returns the aspect ratio that ZDoom assumes the screen is. ZDoom uses tricky code for that.
  
 +===== Actual screen boundaries =====
 +[[functions:HudLeftFor]], [[functions:HudRightFor]], [[functions:HudTopFor]] and [[functions:HudBottomFor]] return actual screen boundaries in the HUD coordinate system for the specified width and height of the HUD coordinate system, taking the current aspect ratio into account.
  
 +To avoid specifying a width or height every time, you can call [[functions:HudSetVirtualSize]] once and then call [[functions:HudLeft]], [[functions:HudRight]], [[functions:HudTop]] and [[functions:HudBottom]].
hud_coordinate_system.txt · Last modified: 2017/04/18 16:39 by korshun