aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2020-04-11 23:09:46 +0200
committerGitHub <noreply@github.com>2020-04-11 22:09:46 +0100
commitaf2e6a6a10121cf971d4ce4c33d523b6dc037d31 (patch)
tree19776d03803bf383476d629202aafdc1ed7107c4 /doc
parentf780bae05cc2fdd23a6d7326c770783da8d94ea3 (diff)
downloadminetest-af2e6a6a10121cf971d4ce4c33d523b6dc037d31.tar.gz
minetest-af2e6a6a10121cf971d4ce4c33d523b6dc037d31.tar.bz2
minetest-af2e6a6a10121cf971d4ce4c33d523b6dc037d31.zip
Improve waypoints and add image variant (#9480)
Diffstat (limited to 'doc')
-rw-r--r--doc/client_lua_api.txt25
-rw-r--r--doc/lua_api.txt20
2 files changed, 44 insertions, 1 deletions
diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt
index 71df91c68..53ed680d0 100644
--- a/doc/client_lua_api.txt
+++ b/doc/client_lua_api.txt
@@ -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`)
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index b083b2907..1a9aad344 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1364,10 +1364,30 @@ Displays distance to selected world position.
* `name`: The name of the waypoint.
* `text`: Distance suffix. Can be blank.
+* `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.