1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Add direction parameter to statbars in HUD API

Fix health bar overlap when a larger texture is used
This commit is contained in:
kwolekr 2013-04-20 00:21:32 -04:00
parent c45c530f74
commit 527deb947c
4 changed files with 54 additions and 33 deletions

View file

@ -407,6 +407,8 @@ The position field is used for all element types.
To account for differing resolutions, the position coordinates are the percentage of the screen,
ranging in value from 0 to 1.
The name field is not yet used, but should contain a description of what the HUD element represents.
The direction field is the direction in which something is drawn.
0 draws from left to right, 1 draws from right to left, 2 draws from top to bottom, and 3 draws from bottom to top.
Below are the specific uses for fields in each type; fields not listed for that type are ignored.
Note: Future revisions to the HUD API may be incompatible; the HUD API is still in the experimental stages.
@ -428,15 +430,12 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still
- text: The name of the texture that is used.
- number: The number of half-textures that are displayed.
If odd, will end with a vertically center-split texture.
- direction
- inventory
- text: The name of the inventory list to be displayed.
- number: Number of items in the inventory to be displayed.
- item: Position of item that is selected.
- direction: Direction in which the inventory list is drawn.
0 draws from left to right,
1 draws from right to left,
2 draws from top to bottom, and
3 draws from bottom to top.
- direction
Representations of simple things
--------------------------------
@ -1856,6 +1855,6 @@ HUD Definition (hud_add, hud_get)
number = 2,
item = 3,
^ Selected item in inventory. 0 for no item selected.
dir = 0,
direction = 0,
^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top
}