tile.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---@meta
  2. ---Tile definition
  3. ------------------
  4. -- Can be a name (string) or `mt.TileTableDef`.
  5. ---@alias mt.TileDef mt.TileTableDef|string
  6. -- Tile definition.
  7. ---@class mt.TileTableDef
  8. ---@field name string|nil
  9. ---@field animation mt.TileAnimDef|nil
  10. -- Backface culling enabled by default for most nodes.
  11. ---@field backface_culling boolean|nil
  12. -- Align style determines whether the texture will be rotated with the node
  13. -- or kept aligned with its surroundings. "user" means that client
  14. -- setting will be used, similar to `glasslike_framed_optional`.
  15. -- Note: supported by solid nodes and nodeboxes only.
  16. ---@field align_style "node"|"world"|"user"|nil
  17. -- Scale is used to make texture span several (exactly `scale`) nodes,
  18. -- instead of just one, in each direction. Works for world-aligned
  19. -- textures only.
  20. -- Note that as the effect is applied on per-mapblock basis, `16` should
  21. -- be equally divisible by `scale` or you may get wrong results.
  22. ---@field scale integer|nil
  23. -- * The texture's color will be multiplied with this color.
  24. -- * The tile's color overrides the owning node's color in all cases.
  25. ---@field color mt.ColorSpec|nil
  26. ---@field image string|nil Deprecated synonym for field `name`.
  27. -- Tile animation definition.
  28. ---@class mt.TileAnimDef
  29. ---@field type "vertical_frames"|"sheet_2d"|nil
  30. ---@field aspect_w number|nil Width of a frame in pixels ("vertical_frames").
  31. ---@field aspect_h number|nil Height of a frame in pixels ("vertical_frames").
  32. ---@field length number|nil Full loop length ("vertical_frames").
  33. ---@field frames_w number|nil Width in number of frames ("sheet_2d").
  34. ---@field frames_h number|nil Height in number of frames ("sheet_2d").
  35. ---@field frame_length number|nil Length of a single frame ("sheet_2d").