AW HUD ELEMENT ORIGIN
Minimum requirements | ||
---|---|---|
Added in version 4.1 | ||
SDK | build 64 |
AW_HUD_ELEMENT_ORIGIN
Type
Integer
Description
Origin of a HUD element.
Notes
This attribute specifies the "anchor point" for the HUD element. Note that viewports are re-sizeable on the client. At any time, the user may change the size and aspect ratio of their 3d window. This makes the predicable positioning of elements somewhat tricky. It would be unwise, for example, to place an element 300 pixels from the left edge of the screen and 400 pixels down from the top edge. For some users this would place the element near the middle. For others the element may wind up on the bottom edge. Some users with a very small viewport will not show the element at all!
So, to aid in the positioning of elements within an area of unpredicable size, elements have nine "anchor points" from which they may start. These are:
- AW_HUD_ORIGIN_TOP_LEFT
- AW_HUD_ORIGIN_TOP
- AW_HUD_ORIGIN_TOP_RIGHT
- AW_HUD_ORIGIN_LEFT
- AW_HUD_ORIGIN_CENTER
- AW_HUD_ORIGIN_RIGHT
- AW_HUD_ORIGIN_BOTTOM_LEFT
- AW_HUD_ORIGIN_BOTTOM
- AW_HUD_ORIGIN_BOTTOM_RIGHT
The top, left, right and bottom points appear in the exact center of the given edge.
This point will specify the position of the upper left corner of your HUD element. Note that this means that for all origin points on the bottom and right edge of the screen, the element will not be visible in the default position! These origins are a place to start, but to properly place an element where you want it, you should set AW_HUD_ELEMENT_X and AW_HUD_ELEMENT_Y to an appropriate value.
For example, if you wanted to place a 64x64 element in the lower left corner, then you should set the origin to AW_HUD_ORIGIN_BOTTOM_RIGHT, and then set AW_HUD_ELEMENT_X and AW_HUD_ELEMENT_Y to -64.