This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
functions:hudlib [2016/08/09 19:44] – [HudSetCameraAngles] korshun | functions: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 | + | Drawing |
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | ==== Simple 2D drawing ==== | ||
+ | |||
+ | < | ||
+ | HudSetPoint(320.0, | ||
+ | HudDrawText(1, | ||
+ | </ | ||
+ | |||
+ | ==== Simple 3D drawing ==== | ||
+ | |||
+ | < | ||
+ | HudSetCameraActor(0); | ||
+ | HudSetPoint3D(0.0, | ||
+ | HudDrawText(2, | ||
+ | </ | ||
===== Virtual screen size ===== | ===== Virtual screen size ===== | ||
Line 18: | Line 35: | ||
'' | '' | ||
- | Sets the virtual screen size to the given dimensions. The default size is 640x480. This works exactly like '' | + | Sets the virtual screen size to the given dimensions. The default size is 640x480. This works exactly like '' |
==== HudUseRealSize ==== | ==== HudUseRealSize ==== | ||
Line 34: | Line 51: | ||
Controls whether the statusbar area should be included into the virtual screen. This corresponds to the third parameter of '' | Controls whether the statusbar area should be included into the virtual screen. This corresponds to the third parameter of '' | ||
+ | |||
+ | ===== Widescreen support ===== | ||
+ | |||
+ | ==== Hud boundaries ==== | ||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | 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** | ||
+ | |||
+ | < | ||
+ | // This message will stick to the left border of the screen (with a gap), even in widescren. | ||
+ | HudSetPoint(HudLeft() + 3.0, 240.0); | ||
+ | </ | ||
+ | |||
+ | ==== Hud borders ==== | ||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | Return hud borders for current virtual screen size, accounting for current **physical** aspect ratio. | ||
===== 2D positioning ===== | ===== 2D positioning ===== | ||
Line 210: | Line 254: | ||
'' | '' | ||
- | If set to true, the message will be shown to everyone, and not just to the activator. This settings | + | If set to true, the message will be shown to everyone, and not just to the activator. This setting |
==== HudSetLayer ==== | ==== HudSetLayer ==== | ||
Line 258: | Line 302: | ||
<note important> | <note important> | ||
- | <note tip>If you want to do '' | + | <note tip>If you want to do '' |
==== HudSetCameraActor ==== | ==== HudSetCameraActor ==== |