From 13ad8e2a090eec97f31a1c62e2052a51dcff4434 Mon Sep 17 00:00:00 2001 From: v-rob Date: Mon, 16 Mar 2020 14:56:48 -0700 Subject: Formspecs: Add starting frame to `animated_image` (#9411) --- doc/lua_api.txt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'doc') 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[;;;]` * Adds tooltip for an element -* `` tooltip background color as `ColorString` (optional) -* `` tooltip font color as `ColorString` (optional) +* `bgcolor` tooltip background color as `ColorString` (optional) +* `fontcolor` tooltip font color as `ColorString` (optional) ### `tooltip[,;,;;;]` * Adds tooltip for an area. Other tooltips will take priority when present. -* `` tooltip background color as `ColorString` (optional) -* `` tooltip font color as `ColorString` (optional) +* `bgcolor` tooltip background color as `ColorString` (optional) +* `fontcolor` tooltip font color as `ColorString` (optional) ### `image[,;,;]` * Show an image -### `animated_image[,;,;:,]` +### `animated_image[,;,;;;;;]` * 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 -* `` is the image to use -* `` is the number of frames animating the image -* `` 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[,;,;]` @@ -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 -- cgit v1.2.3