box.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw a box.',
  4. description = [[
  5. Draws a box. This is similar to `lovr.graphics.cube` except you can have different values for
  6. the width, height, and depth of the box.
  7. ]],
  8. arguments = {
  9. material = {
  10. type = 'Material',
  11. description = 'The Material to apply to the box.'
  12. },
  13. mode = {
  14. type = 'DrawStyle',
  15. description = 'How to draw the box.'
  16. },
  17. transform = {
  18. type = 'mat4',
  19. description = 'The transform of the box.'
  20. },
  21. x = {
  22. type = 'number',
  23. default = '0',
  24. description = 'The x coordinate of the center of the box.'
  25. },
  26. y = {
  27. type = 'number',
  28. default = '0',
  29. description = 'The y coordinate of the center of the box.'
  30. },
  31. z = {
  32. type = 'number',
  33. default = '0',
  34. description = 'The z coordinate of the center of the box.'
  35. },
  36. width = {
  37. type = 'number',
  38. default = '1',
  39. description = 'The width of the box, in meters.'
  40. },
  41. height = {
  42. type = 'number',
  43. default = '1',
  44. description = 'The height of the box, in meters.'
  45. },
  46. depth = {
  47. type = 'number',
  48. default = '1',
  49. description = 'The depth of the box, in meters.'
  50. },
  51. angle = {
  52. type = 'number',
  53. default = '0',
  54. description = 'The rotation of the box around its rotation axis, in radians.'
  55. },
  56. ax = {
  57. type = 'number',
  58. default = '0',
  59. description = 'The x coordinate of the axis of rotation.'
  60. },
  61. ay = {
  62. type = 'number',
  63. default = '1',
  64. description = 'The y coordinate of the axis of rotation.'
  65. },
  66. az = {
  67. type = 'number',
  68. default = '0',
  69. description = 'The z coordinate of the axis of rotation.'
  70. }
  71. },
  72. returns = {},
  73. variants = {
  74. {
  75. arguments = { 'mode', 'x', 'y', 'z', 'width', 'height', 'depth', 'angle', 'ax', 'ay', 'az' },
  76. returns = {}
  77. },
  78. {
  79. arguments = { 'material', 'x', 'y', 'z', 'width', 'height', 'depth', 'angle', 'ax', 'ay', 'az' },
  80. returns = {}
  81. },
  82. {
  83. arguments = { 'mode', 'transform' },
  84. returns = {}
  85. },
  86. {
  87. arguments = { 'material', 'transform' },
  88. returns = {}
  89. }
  90. }
  91. }