forked from Mineclonia/Mineclonia
E
842cc6d1e4
Formspecs come in different versions. While maintaining the same basic syntax, version 1->2 changed (among other things) how coordinates work by eliminating some (previously) built-in spacing and padding. This commit adds a number of utility functions that can be used to upgrade a formspec in-place. - `size2r` returns a string with the provided w,h coordinates converted for use with `size[]` in formspec versions 2+ - `i2r` converts a single coordinate from the V1 coordinates system to the V2+ "Real" coordinates - `xy2r` returns a string suitable for use with other elements that accept a coordinate pair. It is a simple wrapper for `i2r`. The formulas used reflect those specified by the Minetest Lua API docs. |
||
---|---|---|
.. | ||
textures | ||
init.lua | ||
mod.conf |