roundrect.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a rounded rectangle.',
  4. description = 'Draws a rounded rectangle.',
  5. arguments = {
  6. x = {
  7. type = 'number',
  8. default = '0',
  9. description = 'The x coordinate of the center of the rectangle.'
  10. },
  11. y = {
  12. type = 'number',
  13. default = '0',
  14. description = 'The y coordinate of the center of the rectangle.'
  15. },
  16. z = {
  17. type = 'number',
  18. default = '0',
  19. description = 'The z coordinate of the center of the rectangle.'
  20. },
  21. width = {
  22. type = 'number',
  23. default = '1',
  24. description = 'The width of the rectangle.'
  25. },
  26. height = {
  27. type = 'number',
  28. default = '1',
  29. description = 'The height of the rectangle.'
  30. },
  31. thickness = {
  32. type = 'number',
  33. default = '1',
  34. description = 'The thickness of the rectangle.'
  35. },
  36. angle = {
  37. type = 'number',
  38. default = '0',
  39. description = 'The rotation of the rectangle around its rotation axis, in radians.'
  40. },
  41. ax = {
  42. type = 'number',
  43. default = '0',
  44. description = 'The x component of the axis of rotation.'
  45. },
  46. ay = {
  47. type = 'number',
  48. default = '1',
  49. description = 'The y component of the axis of rotation.'
  50. },
  51. az = {
  52. type = 'number',
  53. default = '0',
  54. description = 'The z component of the axis of rotation.'
  55. },
  56. position = {
  57. type = 'Vec3',
  58. description = 'The position of the rectangle.'
  59. },
  60. size = {
  61. type = 'Vec3',
  62. description = 'The size of the rectangle (width, height, thickness).'
  63. },
  64. orientation = {
  65. type = 'Quat',
  66. description = 'The orientation of the rectangle.'
  67. },
  68. transform = {
  69. type = 'Mat4',
  70. description = 'The transform of the rectangle.'
  71. },
  72. radius = {
  73. type = 'number',
  74. default = '0',
  75. description = [[
  76. The radius of the rectangle corners. If the radius is zero or negative, the rectangle will
  77. have sharp corners.
  78. ]]
  79. },
  80. segments = {
  81. type = 'number',
  82. default = '8',
  83. description = [[
  84. The number of circular segments to use for each corner. This increases the smoothness, but
  85. increases the number of vertices in the mesh.
  86. ]]
  87. }
  88. },
  89. returns = {},
  90. variants = {
  91. {
  92. arguments = { 'x', 'y', 'z', 'width', 'height', 'thickness', 'angle', 'ax', 'ay', 'az', 'radius', 'segments' },
  93. returns = {}
  94. },
  95. {
  96. arguments = { 'position', 'size', 'orientation', 'radius', 'segments' },
  97. returns = {}
  98. },
  99. {
  100. arguments = { 'transform', 'radius', 'segments' },
  101. returns = {}
  102. }
  103. }
  104. }