diff options
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 |