AW HUD ELEMENT FLAGS

From ActiveWiki
Revision as of 13:01, 18 October 2008 by Macavity (talk | contribs) (Added in, cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Minimum requirements
Added in version 4.1
SDKbuild 64


AW_HUD_ELEMENT_FLAGS

Type

Integer

Description

AW_HUD_ELEMENT_FLAGS is a value that must be set prior to calling aw_hud_create when using the HUD system.

Notes

The value of this attribute can be any combination of the following bitwise flags:

 AW_HUD_ELEMENT_FLAG_CLICKS        = 0x0001,
 AW_HUD_ELEMENT_FLAG_STRETCH       = 0x0002,
 AW_HUD_ELEMENT_FLAG_ADDITIVE      = 0x0004,
 AW_HUD_ELEMENT_FLAG_SIZE_PERCENT  = 0x0008,
 AW_HUD_ELEMENT_FLAG_TRANSITION    = 0x0010,
 AW_HUD_ELEMENT_FLAG_TEMPORARY     = 0x0020,
 AW_HUD_ELEMENT_FLAG_UNIVERSE_PATH = 0x0040,
 AW_HUD_ELEMENT_FLAG_CLAMP         = 0x0080,
 AW_HUD_ELEMENT_FLAG_HIGHLIGHT     = 0x0100,
AW_HUD_ELEMENT_FLAG_CLICKS
This flag specifies that this element should generate HUD_CLICK events. Note that users cannot click "through" HUD elements with this flag set, meaning that if a HUD element is in the way, they cannot click on objects within the 3d scene.
AW_HUD_ELEMENT_FLAG_STRETCH
'This flag dictates that the texture should be resized as needed to force it to fit within the HUD element. By default it will only show as many pixels as it can. So a 128x128 texture in a 64x64 element would cause the user to only see the upper-left corner of the image. Likewise, a 128x128 texture in a 256x256 element would cause the texture to "tile". Using the stretch flag fixes this, and foces the texture to be shown once and only once, no matter the size.
Text elements are always set to stretch.
AW_HUD_ELEMENT_FLAG_ADDITIVE
This will make the element perform an additive blend when rendering, thus making it appear to "glow".
AW_HUD_ELEMENT_FLAG_SIZE_PERCENT
This flag is not currently used, and will have no effect. It may be added or changed at some point in the future.
AW_HUD_ELEMENT_FLAG_TRANSITION
Transition is useful when updating existing elements. If this flag is true, then the element will smoothly adjust to its new position, color, texture mapping, and opacity over a period of a half-second.
AW_HUD_ELEMENT_FLAG_TEMPORARY
Temporary is useful when altering existing HUD elements. If you specify this flag along with the transition flag, then the element will move to the new position and then back, with a total round-trip time of one second.
AW_HUD_ELEMENT_FLAG_UNIVERSE_PATH
This will force this element to download its texture from the universe texture path instead of the local world texture path.
AW_HUD_ELEMENT_FLAG_CLAMP
Clamp is only meaningful for image-based elements. It will lock the edges of the texture, thus preventing it from tiling. If the texture is not big enough to fill the given element space, then the edges are repeated instead of wrapping around to the other side of the texture.
AW_HUD_ELEMENT_FLAG_HIGHLIGHT
Highlight will cause the element to slowly "pulse" or "glow". (The element is actually drawn twice in this case. Once with your normal settings, and a second time using "additive blend", with the additive blend changing strength to create the pulsing.
This is a useful, generic way of drawing attention to a particular element.

Usage

/* make a HUD element which is highlighted and clickable */
aw_int_set (AW_HUD_ELEMENT_FLAGS, AW_HUD_ELEMENT_FLAG_HIGHLIGHT | AW_HUD_ELEMENT_FLAG_CLICKS);

Used by