summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-06-22 15:03:54 +0100
committerSmallJoker <SmallJoker@users.noreply.github.com>2019-06-22 16:03:54 +0200
commit429a98964859b83016f2eb47a47a08ab8dc3c57e (patch)
treeb02a16132e5cdf6696917910921942c464bc39c6 /doc
parent4e3c1916f731058a137ec1f9eecf2b7eff4d8fcc (diff)
downloadminetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.tar.gz
minetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.tar.bz2
minetest-429a98964859b83016f2eb47a47a08ab8dc3c57e.zip
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
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt17
1 files changed, 15 insertions, 2 deletions
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[<X>,<Y>;<W>,<H>;<texture name>]`
-* 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[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>]`
-* 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[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`
+
+* 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