diff options
author | v-rob <robinsonvincent89@gmail.com> | 2020-03-16 14:56:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 22:56:48 +0100 |
commit | 13ad8e2a090eec97f31a1c62e2052a51dcff4434 (patch) | |
tree | f13d97357516f5ed427143a045f5daf14876a8be /doc/lua_api.txt | |
parent | 1441281809d9961ff7498df86601db151956b030 (diff) | |
download | minetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.tar.gz minetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.tar.bz2 minetest-13ad8e2a090eec97f31a1c62e2052a51dcff4434.zip |
Formspecs: Add starting frame to `animated_image` (#9411)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r-- | doc/lua_api.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 5a3e37292..334bd01a0 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2120,27 +2120,29 @@ Elements ### `tooltip[<gui_element_name>;<tooltip_text>;<bgcolor>;<fontcolor>]` * Adds tooltip for an element -* `<bgcolor>` tooltip background color as `ColorString` (optional) -* `<fontcolor>` tooltip font color as `ColorString` (optional) +* `bgcolor` tooltip background color as `ColorString` (optional) +* `fontcolor` tooltip font color as `ColorString` (optional) ### `tooltip[<X>,<Y>;<W>,<H>;<tooltip_text>;<bgcolor>;<fontcolor>]` * Adds tooltip for an area. Other tooltips will take priority when present. -* `<bgcolor>` tooltip background color as `ColorString` (optional) -* `<fontcolor>` tooltip font color as `ColorString` (optional) +* `bgcolor` tooltip background color as `ColorString` (optional) +* `fontcolor` tooltip font color as `ColorString` (optional) ### `image[<X>,<Y>;<W>,<H>;<texture name>]` * Show an image -### `animated_image[<X>,<Y>;<W>,<H>;<texture name>:<frame count>,<frame duration>]` +### `animated_image[<X>,<Y>;<W>,<H>;<name>;<texture name>;<frame count>;<frame duration>;<frame start>]` * Show an animated image. The image is drawn like a "vertical_frames" tile - animation (See Tile animation definition), but uses a frame count/duration + animation (See [Tile animation definition]), but uses a frame count/duration for simplicity -* `<texture name>` is the image to use -* `<frame count>` is the number of frames animating the image -* `<frame duration>` is in milliseconds +* `name`: Element name to send when an event occurs. The event value is the index of the current frame. +* `texture name`: The image to use. +* `frame count`: The number of frames animating the image. +* `frame duration`: Milliseconds between each frame. `0` means the frames don't advance. +* `frame start` (Optional): The index of the frame to start on. Default `1`. ### `item_image[<X>,<Y>;<W>,<H>;<item name>]` @@ -2575,6 +2577,7 @@ Setting a property to nothing will reset it to the default value. For example: Some types may inherit styles from parent types. +* animated_image, inherits from image * button * button_exit, inherits from button * checkbox @@ -4325,6 +4328,7 @@ Call these functions only at load time! is a table containing each formspecs element value (as string), with the `name` parameter as index for each. The value depends on the formspec element type: + * `animated_image`: Returns the index of the current frame. * `button` and variants: If pressed, contains the user-facing button text as value. If not pressed, is `nil` * `field`, `textarea` and variants: Text in the field |