From 78a801e42daf53eca0fcc6e791b9eb49e850c207 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Thu, 19 Jul 2018 18:28:26 +0200 Subject: [PATCH] Update mip mapping and textarea documentation (#7315) * Fix textarea formspec documentation The label is shown and the background isn't * Document the missing gamma correction when generating mip maps * Remove duplicate text (such as size parameter descriptions) --- builtin/settingtypes.txt | 4 ++- doc/lua_api.txt | 60 ++++++++++++---------------------------- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 40c4e8b16..9a62ae964 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -424,7 +424,9 @@ enable_particles (Digging particles) bool true [**Filtering] -# Use mip mapping to scale textures. May slightly increase performance. +# Use mip mapping to scale textures. May slightly increase performance, +# especially when using a high resolution texture pack. +# Gamma correct downscaling is not supported. mip_map (Mipmapping) bool false # Use anisotropic filtering when viewing at textures from an angle. diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 2f8255cb4..c3e2a3919 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -1779,6 +1779,13 @@ supported. It is a string, with a somewhat strange format. Spaces and newlines can be inserted between the blocks, as is used in the examples. +Position and size units are inventory slots, `X` and `Y` position the formspec +element relative to the top left of the menu or container. `W` and `H` are its +width and height values. +When displaying text which can contain formspec code, e.g. text set by a player, +use `minetest.formspec_escape`. +For coloured text you can use `minetest.colorize`. + WARNING: Minetest allows you to add elements to every single formspec instance using player:set_formspec_prepend(), which may be the reason backgrounds are appearing when you don't expect them to. See `no_prepend[]` @@ -1892,11 +1899,9 @@ Elements ### `image[,;,;]` * Show an image -* Position and size units are inventory slots ### `item_image[,;,;]` * Show an inventory image of registered item/node -* Position and size units are inventory slots ### `bgcolor[;]` * Sets background color of formspec as `ColorString` @@ -1905,26 +1910,21 @@ Elements ### `background[,;,;]` * Use a background. Inventory rectangles are not drawn then. -* Position and size units are inventory slots * 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. -* Position and size units are inventory slots * Example for formspec 8x4 in 16x resolution: image shall be sized 8 times 16px times 4 times 16px -* If `true` the background is clipped to formspec size +* 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) ### `pwdfield[,;,;;