This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
hud_library [2017/04/17 16:37] – korshun | hud_library [2017/04/18 16:27] – korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== HUD Library | + | ====== HUD Library ====== |
+ | HUD Library is an advanced replacement for [[zdoom> | ||
- | HUD library state can be reset to default using [[functions:HudResetState]]. | + | Here is an example: |
- | ===== 2D drawing ===== | + | < |
- | These settings apply to 2D drawing only. | + | HudResetState(); |
+ | HudSetPoint(320.0, | ||
+ | HudDrawText(1, | ||
+ | </ | ||
- | ==== 2D position ===== | + | The only drawing functions in HUD Library are [[functions: |
- | The current 2D point in the [[HUD coordinate system]] to draw the message at. | + | ===== Scaling ===== |
- | **Default:** '' | + | Scaling is implemented by calling SetHudSize with values that don't match those set in [[functions:HudSetVirtualSize]]. |
- | Manipulated by [[functions:HudSetPoint]]. | + | For example: |
- | ---- | + | |
- | ===== General appearance ===== | + | |
- | ==== 2D/3D mode ===== | + | |
- | Whether to draw in 2D or 3D mode. | + | |
- | **Default: | + | < |
+ | HudResetState(); | ||
+ | HudSetVirtualSize(640.0, 480.0); | ||
+ | HudSetScale(0.5); | ||
+ | HudDrawText(1, | ||
+ | </ | ||
- | Manipulated by: | + | Will result in the following sequence of calls to ZDoom' |
- | * [[functions:HudSetPoint]] | + | < |
- | * [[functions: | + | SetFont(" |
+ | SetHudSize(1280, 1024, 0); // To implement 0.5 scale | ||
+ | HudMessage(s:" | ||
+ | </ | ||
- | ---- | + | ===== 3D messages ===== |
- | ==== Scale ==== | + | HUD Library supports an accurate projection |
- | Current X and Y scale of the message to draw. | + | |
- | **Default:** '' | + | Example: |
- | Manipulated by: | + | <code> |
- | * [[functions: | + | HudResetState(); |
- | * [[functions: | + | HudSetPoint3D(x, y, z); |
- | * [[functions: | + | HudSetCameraActor(0); // Set HUD Library |
- | * [[functions: | + | HudDrawText(1, "Look here!" |
- | + | </ | |
- | ---- | + | |
- | ==== Show to everyone ==== | + | |
- | Whether to use [[zdoom>HudMessage]] or [[zdoom> | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== Appearance time ==== | + | |
- | Duration of fade-in animation. 0 disables fade-in animation and makes the message appear instantly. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== Stay time ==== | + | |
- | For how long the message stays after the end of fade-in and before the beginning fade-out. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== Disappearance time ==== | + | |
- | Duration of fade-out animation. 0 disables fade-out animation and makes the message disappear instantly. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== 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: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== Alpha ==== | + | |
- | The alpha (opaqueness) of the message. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ===== Text drawing ===== | + | |
- | These settings apply only to [[functions: | + | |
- | ---- | + | |
- | ==== Word wrap ==== | + | |
- | Whether to enable word wrap when the message goes off the right edge of the screen. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ===== 3D drawing ===== | + | |
- | These settings apply to 3D drawing only. | + | |
- | + | ||
- | ==== 3D position ==== | + | |
- | The current 3D point to draw the message at. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | ---- | + | |
- | ==== Camera position ==== | + | |
- | The 3D position of the camera. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by: | + | |
- | * [[functions: | + | |
- | * [[functions: | + | |
- | * [[functions: | + | |
- | + | ||
- | ---- | + | |
- | ==== Camera direction ==== | + | |
- | The direction of the camera. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by: | + | |
- | * [[functions: | + | |
- | * [[functions: | + | |
- | * [[functions: | + | |
- | + | ||
- | ---- | + | |
- | ==== 2D offset ==== | + | |
- | A 2D offset | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | + | ||
- | ---- | + | |
- | ==== 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 [[functions: | + | |
- | * HUD_PROJECTION_3D -- true 3D projection. | + | |
- | * HUD_PROJECTION_YSHEARING -- a 3D projection with Y-shearing like in software renderer. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
- | + | ||
- | ---- | + | |
- | ==== Auto distance scale ==== | + | |
- | Whether to multiply the scale of the message by a factor to make it change size with distance. | + | |
- | + | ||
- | **Default: | + | |
- | + | ||
- | Manipulated by [[functions: | + | |
+ | [[functions: | ||
+ | By default, 3D messages are automatically scaled with distance. You can disable this setting using [[functions: | ||
+ | ===== State operations ===== | ||
+ | The whole [[HUD Library state]] can be reset to default using [[functions: |