mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Added offset support for HUD items
This commit is contained in:
parent
7c37b1891a
commit
9894167bbf
9 changed files with 43 additions and 8 deletions
|
@ -412,6 +412,9 @@ The direction field is the direction in which something is drawn.
|
|||
The alignment field specifies how the item will be aligned. It ranges from -1 to 1,
|
||||
with 0 being the center, -1 is moved to the left/up, and 1 is to the right/down. Fractional
|
||||
values can be used.
|
||||
The offset field specifies a pixel offset from the position. Contrary to position,
|
||||
the offset is not scaled to screen size. This allows for some precisely-positioned
|
||||
items in the HUD.
|
||||
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.
|
||||
|
@ -422,6 +425,7 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still
|
|||
Only the X coordinate scale is used.
|
||||
- text: The name of the texture that is displayed.
|
||||
- alignment: The alignment of the image.
|
||||
- offset: offset in pixels from position.
|
||||
- text
|
||||
Displays text on the HUD.
|
||||
- scale: Defines the bounding rectangle of the text.
|
||||
|
@ -430,12 +434,14 @@ Note: Future revisions to the HUD API may be incompatible; the HUD API is still
|
|||
- number: An integer containing the RGB value of the color used to draw the text.
|
||||
Specify 0xFFFFFF for white text, 0xFF0000 for red, and so on.
|
||||
- alignment: The alignment of the text.
|
||||
- offset: offset in pixels from position.
|
||||
- statbar
|
||||
Displays a horizontal bar made up of half-images.
|
||||
- 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
|
||||
- offset: offset in pixels from position.
|
||||
- inventory
|
||||
- text: The name of the inventory list to be displayed.
|
||||
- number: Number of items in the inventory to be displayed.
|
||||
|
@ -1864,4 +1870,6 @@ HUD Definition (hud_add, hud_get)
|
|||
^ Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top
|
||||
alignment = {x=0, y=0},
|
||||
^ See "HUD Element Types"
|
||||
offset = {x=0, y=0},
|
||||
^ See "HUD Element Types"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue