Mineclonia/mods/HUD/mcl_formspec
E 842cc6d1e4 hud/mcl_formspec: add formspec V2 conversion utilities
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.
2021-05-02 00:54:52 -04:00
..
textures Revert "Add dummy inventory images for backwards-compat" 2020-03-29 14:38:39 +02:00
init.lua hud/mcl_formspec: add formspec V2 conversion utilities 2021-05-02 00:54:52 -04:00
mod.conf Generate item slot images on the fly 2020-03-24 18:48:14 +01:00