hud.lua 876 B

12345678910111213141516171819202122232425
  1. ---@meta
  2. ---HUD Definition
  3. -----------------
  4. -- Used by `Player:hud_add`. Returned by `Player:hud_get`.
  5. ---@class mt.HUDDef
  6. ---@field hud_elem_type "image"|"text"|"statbar"|"inventory"|"compass"|"minimap"
  7. ---@field position mt.Vector Left corner position of element.
  8. ---@field name string
  9. ---@field scale mt.Vector
  10. ---@field text string
  11. ---@field text2 string
  12. ---@field number number
  13. ---@field item number Selected item in inventory. 0 for no item selected.
  14. -- Direction: 0: left-right, 1: right-left, 2: top-bottom, 3: bottom-top.
  15. ---@field direction integer
  16. ---@field alignment mt.Vector
  17. ---@field offset mt.Vector
  18. ---@field size mt.Vector Size of element in pixels.
  19. -- Lower z-index HUDs are displayed behind higher z-index HUDs.
  20. ---@field z_index number
  21. -- For "text" elements sets font style:
  22. -- bitfield with 1 = bold, 2 = italic, 4 = monospace.
  23. ---@field style number