From 429a98964859b83016f2eb47a47a08ab8dc3c57e Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 22 Jun 2019 15:03:54 +0100 Subject: Add support for 9-sliced backgrounds (#8600) 9-slice textures are commonly used in GUIs to allow scaling them to match any resolution without distortion. https://en.wikipedia.org/wiki/9-slice_scaling --- doc/lua_api.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'doc/lua_api.txt') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 352b04cb0..155da14e3 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2034,13 +2034,26 @@ Elements ### `background[,;,;]` -* Use a background. Inventory rectangles are not drawn then. * Example for formspec 8x4 in 16x resolution: image shall be sized 8 times 16px times 4 times 16px. ### `background[,;,;;]` -* Use a background. Inventory rectangles are not drawn then. +* Example for formspec 8x4 in 16x resolution: + image shall be sized 8 times 16px times 4 times 16px +* If `auto_clip` is `true`, the background is clipped to the formspec size + (`x` and `y` are used as offset values, `w` and `h` are ignored) + +### `background[,;,;;;]` + +* 9-sliced background. See https://en.wikipedia.org/wiki/9-slice_scaling +* Middle is a rect which defines the middle of the 9-slice. + * `x` - The middle will be x pixels from all sides. + * `x,y` - The middle will be x pixels from the horizontal and y from the vertical. + * `x,y,x2,y2` - The middle will start at x,y, and end at x2, y2. Negative x2 and y2 values + will be added to the width and height of the texture, allowing it to be used as the + distance from the far end. + * All numbers in middle are integers. * Example for formspec 8x4 in 16x resolution: image shall be sized 8 times 16px times 4 times 16px * If `auto_clip` is `true`, the background is clipped to the formspec size -- cgit v1.2.3