ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


hud_library_state

HUD Library State

HUD Library has a lot of settings telling it how to draw messages. It stores them in current state.

This state can be reset to default using HudResetState. It can be saved and restored using HudPushState and HudPopState respectively.

2D drawing

These settings apply to 2D drawing only.

2D position

The current 2D point in the HUD coordinate system to draw the message at.

Default: x=0.0 y=0.0

Manipulated by HudSetPoint.


Virtual screen size

The width and height of the HUD coordinate system.

This width and height is stored in HUD Library. SetHudSize is not a replacement for HudSetVirtualSize, because HUD Library needs to overwrite actual SetHudSize dimensions to implement scaling.
Virtual screen size is specified using fixed-point numbers. The restriction on integers in SetHudSize is completely arbitrary.
Virtual screen size affects 3D message size. IF auto distance scale is enabled, the scale of 3D messages will match that of 2D ones at 128 units from the camera plane. If it's disabled, 3D messages will look just like 2D ones at this virtual screen size.

Default: 640×480

Manipulated by HudSetVirtualSize.


Exclude status bar

Whether to exclude status bar from HUD coordinate system. This is equivalent to the third argument to SetHudSize.

Default: false

Manipulated by HudSetExcludeStatusBar.


General appearance

These settings affect all messages drawn through HUD Library.

2D/3D mode

Whether to draw in 2D or 3D mode.

Default: 2D mode.

Manipulated by:


Scale

Current X and Y scale of the message to draw.

Default: x=1.0 y=1.0

Manipulated by:

1 / scale = distance

Show to everyone

Whether to use HudMessage or HudMessageBold.

Default: false (use HudMessage)

Manipulated by HudSetShowToEveryone.


Appearance time

Duration of fade-in animation in seconds. 0 disables fade-in animation and makes the message appear instantly.

When drawing text in typeon mode, this functions sets the appear time per letter. It will take appearTime * numLetters seconds to fully draw the message.

Default: 0.0

Manipulated by HudSetAppearTime.


Stay time

For how long the message stays after the end of fade-in and before the beginning fade-out (in seconds).

Default: HUD_STAYTIME_FOREVER.

Manipulated by HudSetStayTime.


Disappearance time

Duration of fade-out animation in seconds. 0 disables fade-out animation and makes the message disappear instantly.

Default: 0.0

Manipulated by HudSetDisappearTime.


Blend style

Which blend style to use for the message. Can be one of the following:

  • HUD_BLENDSTYLE_NORMAL – normal translucency
  • HUD_BLENDSTYLE_ADDITIVE – additive translucency

Default: HUD_BLENDSTYLE_NORMAL (makes messages with alpha = 1.0 opaque).

Manipulated by HudSetBlendStyle.


Alpha

The alpha (opaqueness) of the message.

Default: 1.0

Manipulated by HudSetAlpha.


Show in 3D view

Whether to show the message in 3D game view. If false, applies HUDMSG_NOTWITH3DVIEW flag to the message.

Default: true

Manipulated by: HudSetShowIn3DView.


Show on overlay automap

Whether to show the message when overlay automap is enabled. If false, applies HUDMSG_NOTWITHOVERLAYMAP flag to the message.

Default: true

Manipulated by: HudSetShowOnOverlayAutomap.


Show on full automap

Whether to show the message in full automap mode. If false, applies HUDMSG_NOTWITHFULLMAP flag to the message.

Default: true

Manipulated by: HudSetShowOnFullAutomap.


HUD layer

Which HUD layer to draw the message at. Uses HUDMSG_LAYER_* constants from ZDoom.

Default: HUDMSG_LAYER_OVERHUD

Manipulated by: HudSetLayer.


Text drawing

These settings apply only to HudDrawText, not to HudDrawImage.

Text font

The font to draw the text with.

Default: “SMALLFONT”

Manipulayed by HudSetTextFont.


Text color

Default text color to use in absence of any color codes.

Default: apply no recoloring to original font.

Note that this differs from ZDoom default of red color.

Manipulated by:

Use HudSetTextColor(CR_UNTRANSLATED) to reset back to default.

Type-on

Whether to make appearance animation use type-on effect instead of fade-in.

Appear time is time per-letter when typeon animation is used.

Default: false

Manipulated by HudSetTextTypeOn.


Word wrap

Whether to enable word wrap when the message goes off the right edge of the screen.

Default: false

Manipulated by HudSetWordWrap.


Text origin

Which point of the text box to position.

Horizontal origin can be one of:

  • HUD_TEXTORIGIN_LEFT
  • HUD_TEXTORIGIN_CENTER
  • HUD_TEXTORIGIN_RIGHT

Vertical origin can be one of:

  • HUD_TEXTORIGIN_TOP
  • HUD_TEXTORIGIN_CENTER
  • HUD_TEXTORIGIN_BOTTOM

Default: HUD_TEXTORIGIN_CENTER HUD_TEXTORIGIN_CENTER

Manipulated by:


Center text

Whether to center multiline text in the box.

Default: false

Manipulated by HudSetCenterText.


Logging

Whether to log the text of the message to the console using HUDMSG_LOG flag.

Default: false

Manipulated by HudSetLogMessage


3D drawing

These settings apply to 3D drawing only.

3D position

The current 3D point to draw the message at.

Default: x=0.0 y=0.0 z=0.0

Manipulated by HudSetPoint3D.


Camera position

The 3D position of the camera that views the 3D points.

Default: x=0.0 y=0.0 z=0.0

Manipulated by:


Camera direction

The direction of the camera that views the 3D points.

Default: along the world X axis.

Manipulated by:


2D offset

A 2D offset to shift the message on screen by.

Default: x=0.0 y=0.0

Manipulated by HudSet2DOffset.


Projection mode

3D projection mode to convert 3D coordinates to 2D. Can be one of the following:

  • HUD_PROJECTION_AUTO – use true 3D projection if IsOpenGL returns true and Y-shearing projection otherwise.
  • HUD_PROJECTION_3D – true 3D projection.
  • HUD_PROJECTION_YSHEARING – a 3D projection with Y-shearing like in software renderer.

Default: HUD_PROJECTION_AUTO

Manipulated by HudSetProjectionMode.


Auto distance scale

Whether to multiply the scale of the message by a factor to make it change size with distance.

Default: true

Manipulated by HudSetAutoDistanceScale.

hud_library_state.txt · Last modified: 2017/04/18 16:21 by korshun