ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


new:widescreen

Widescreen support

These function enable true widescreen support in HUD scripts.

Calculating screen boundaries

Actual screen boundaries in widescreen are outside the HUD coordinate system's rectangle. These functions can calculate true screen boundaries in HUD coordinate system.

  • void HudSetVirtualSize(fixed width, fixed height)

Sets the HUD Library's HUD coordinate system size. Default is 640×480. After that, actual screen boundaries in HUD coordinate system for current aspect ratio can be retrieved using the following functions:

  • fixed HudX1() or fixed HudLeft() – left boundary
  • fixed HudX2() or fixed HudRight() – right boundary
  • fixed HudY1() or fixed HudTop() – top boundary
  • fixed HudY2() or fixed HudBottom() – bottom boundary

Example:

// draw this item in the upper left corner of the screen
// uses 640x480 HUD coordinate system
DRAW_ITEM(HudTop(), HudLeft());

Screen boundaries in current aspect ratio can be calculated for any HUD coordinate system size without calling HudSetVirtualSize:

  • fixed HudX1For(fixed width) or fixed HudLeftFor(fixed width) – left boundary for given HUD coordinate system width.
  • fixed HudX2For(fixed width) or fixed HudRightFor(fixed width) – right boundary for given HUD coordinate system width.
  • fixed HudY1For(fixed height) or fixed HudTopFor(fixed height) – top boundary for given HUD coordinate system height.
  • fixed HudY2For(fixed height) or fixed HudBottomFor(fixed height) – bottom boundary for given HUD coordinate system height.
new/widescreen.txt · Last modified: 2018/02/21 14:14 by korshun