1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Improve waypoints and add image variant (#9480)

This commit is contained in:
Lars Müller 2020-04-11 23:09:46 +02:00 committed by GitHub
parent f780bae05c
commit af2e6a6a10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 118 additions and 47 deletions

View file

@ -1416,12 +1416,35 @@ Displays a horizontal bar made up of half-images.
* `offset`: offset in pixels from position.
### `waypoint`
Displays distance to selected world position.
* `name`: The name of the waypoint.
* `text`: Distance suffix. Can be blank.
* `number:` An integer containing the RGB value of the color used to draw the text.
* `precision`: Waypoint precision, integer >= 0. Defaults to 10.
If set to 0, distance is not shown. Shown value is `floor(distance*precision)/precision`.
When the precision is an integer multiple of 10, there will be `log_10(precision)` digits after the decimal point.
`precision = 1000`, for example, will show 3 decimal places (eg: `0.999`).
`precision = 2` will show multiples of `0.5`; precision = 5 will show multiples of `0.2` and so on:
`precision = n` will show multiples of `1/n`
* `number:` An integer containing the RGB value of the color used to draw the
text.
* `world_pos`: World position of the waypoint.
* `offset`: offset in pixels from position.
* `alignment`: The alignment of the waypoint.
### `image_waypoint`
Same as `image`, but does not accept a `position`; the position is instead determined by `world_pos`, the world position of the waypoint.
* `scale`: The scale of the image, with 1 being the original texture size.
Only the X coordinate scale is used (positive values).
Negative values represent that percentage of the screen it
should take; e.g. `x=-100` means 100% (width).
* `text`: The name of the texture that is displayed.
* `alignment`: The alignment of the image.
* `world_pos`: World position of the waypoint.
* `offset`: offset in pixels from position.
### Particle definition (`add_particle`)