[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<hud> XML Node
<hud
name=""
render="TRUE"
texturing="FALSE"
auto_spin="FALSE"
material_name=""
>
<texture
texture_name=""
texture_unit="0"
u_tile="1.0"
v_tile="1.0"
u_offset="0.0"
v_offset="0.0"
u_move="0.0"
v_move="0.0"
>
</texture>
<alpha_test_params
active =""
func=""
ref="0.5"
>
</alpha_test_params>
<blending_params
active ="FALSE"
src_factor="BLENDING_FACTOR_SRC_ALPHA"
dst_factor="BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA"
>
</blending_params>
<position
x=""
y=""
>
</position>
<spin_values
x="0.0"
y="0.0"
z="0.0"
>
</spin_values>
<vertex_color
index="0"
r="1.0"
g="1.0"
b="1.0"
a="1.0"
>
</vertex_color>
</hud>
<hud>
The hud node makes it possible to define 2d elements always displayed on the foreground (as if
they were stuck to the camera). Hud comes from Head Up Display. The majority of the games uses them to
render the scores or life counter. It is relatively significant for the finalization of a scene. Moreover
almost all demos delivered with Demoniak3D integrate one or more Huds.
hud element has 5 attributes and 6 sub-element(s)
- name [STRING]: name of the HUD
- render [BOOLEAN]: enables or disables the hud's rendering. - Default value = TRUE - Values = TRUE|FALSE
- texturing [BOOLEAN]: enables or disables the texturing. - Default value = FALSE - Values = TRUE|FALSE
- auto_spin [BOOLEAN]: enables or disables auto-rotation around HUD's z-axis. - Default value = FALSE - Values = TRUE|FALSE
- material_name [STRING]: material that will replace HUD's default material.
:
<hud name="myHud" render="TRUE" texturing="TRUE" >
<position x="0.0" y="0.0" />
<texture texture_name="hudTexture" texture_unit="0" />
<ablending_params active="FALSE" src_factor="BLENDING_FACTOR_SRC_ALPHA" dst_factor="BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA" />
</hud>
<texture>
Adds a texture.
texture element has 8 attributes and 0 sub-element(s)
- texture_name [STRING]: texture name
- texture_unit [INTEGER]: texture unit on which set the texture - Default value = 0 - Values = [0-7]
- u_tile [REAL]: tiling factor of the u texture coord. - Default value = 1.0
- v_tile [REAL]: tiling factor of the v texture coord. - Default value = 1.0
- u_offset [REAL]: offset of the u texture coord. - Default value = 0.0
- v_offset [REAL]: offset of the v texture coord. - Default value = 0.0
- u_move [REAL]: u coordinate increment at each frame. - Default value = 0.0
- v_move [REAL]: v coordinate increment at each frame. - Default value = 0.0
<alpha_test_params>
Sets the parameters for the hardware alpha-test.
alpha_test_params element has 3 attributes and 0 sub-element(s)
- active [INTEGER]: enables (1) or disables (0) the alpha-test - Values = 0|1
- func [STRING]: alpha comparison function. - Values = CMP_FUNC_NEVER|CMP_FUNC_LESS | CMP_FUNC_LESS_OR_EQUAL | CMP_FUNC_GREATER | CMP_FUNC_GREATER_OR_EQUAL | CMP_FUNC_EQUAL | CMP_FUNC_NOT_EQUAL | CMP_FUNC_ALWAYS
- ref [REAL]: reference value with which the entering alpha value is compared. This reference value must lie between 0.0 and 1.0. - Default value = 0.5
<blending_params>
Sets the parameters for the hardware color blending.
blending_params element has 3 attributes and 0 sub-element(s)
- active [BOOELAN]: enables or disables the blending - Default value = FALSE - Values = TRUE|FALSE
- src_factor [STRING]: blending source factor. - Default value = BLENDING_FACTOR_SRC_ALPHA - Values = BLENDING_FACTOR_ZERO | BLENDING_FACTOR_ONE | BLENDING_FACTOR_SRC_ALPHA | BLENDING_FACTOR_ONE_MINUS_DST_ALPHA | BLENDING_FACTOR_ONE_MINUS_DST_COLOR | BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA | BLENDING_FACTOR_DST_COLOR | BLENDING_FACTOR_DST_ALPHA | BLENDING_FACTOR_SRC_COLOR | BLENDING_FACTOR_ONE_MINUS_SRC_COLOR
- dst_factor [STRING]: blending destination factor. - Default value = BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA - Values = BLENDING_FACTOR_ZERO | BLENDING_FACTOR_ONE | BLENDING_FACTOR_SRC_ALPHA | BLENDING_FACTOR_ONE_MINUS_DST_ALPHA | BLENDING_FACTOR_ONE_MINUS_DST_COLOR | BLENDING_FACTOR_ONE_MINUS_SRC_ALPHA | BLENDING_FACTOR_DST_COLOR | BLENDING_FACTOR_DST_ALPHA | BLENDING_FACTOR_SRC_COLOR | BLENDING_FACTOR_ONE_MINUS_SRC_COLOR
<position>
Sets the hud's center position. The position (0;0) is the center of the 3D window.
position element has 2 attributes and 0 sub-element(s)
- x [REAL]: X coordinate of the position
- y [REAL]: Y coordinate of the position
<spin_values>
Specifies the rotation angles around the X, Y and Z axis. At each frame, the HUD rotation angles are incremented by the specified values. But in the case of a HUD element, only the animation around the axis of Z has a direction.
spin_values element has 3 attributes and 0 sub-element(s)
- x [REAL]: rotation angle around the X axis in degrees - Default value = 0.0
- y [REAL]: rotation angle around the Y axis in degrees - Default value = 0.0
- z [REAL]: rotation angle around the Z axis in degrees - Default value = 0.0
<vertex_color>
Specifies the new color to be applied to one of the four vertices which defines the HUD.
vertex_color element has 5 attributes and 0 sub-element(s)
- index [INTEGER]: index of the vertex to be changed. - Default value = 0 - Values = [0 - 3]
- r [REAL]: red component of the color. - Default value = 1.0
- g [REAL]: green component of the color. - Default value = 1.0
- b [REAL]: blue component of the color. - Default value = 1.0
- a [REAL]: alpha component of the color. - Default value = 1.0
|