1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-12-22 22:55:28 +01:00

Add alpha channel in HUD text elements (#16730)

This commit is contained in:
Zughy
2025-12-20 15:14:08 +01:00
committed by GitHub
parent 4cb32467d3
commit 0fe6827dae
2 changed files with 15 additions and 5 deletions

View File

@@ -1851,8 +1851,11 @@ Displays text on the HUD.
* `text`: The text to be displayed in the HUD element.
Supports `core.translate` (always)
and `core.colorize` (since protocol version 44)
* `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.
* `number`: An integer containing the (A)RGB value of the color used to draw the
text. Specify `0xFFFFFF` for white text, `0x80FF0000` for semi-transparent red, and so on.
* Alpha only works on Luanti 5.15+ clients. Older clients will see the text as opaque.
* To completely hide a text, set `text` to `""`. Setting the alpha value to `00`
will not work due to compatibility reasons (it'll be treated as `FF`).
* `alignment`: The alignment of the text.
* `offset`: offset in pixels from position.
* `size`: size of the text.