circle.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw a 2D circle.',
  4. description = 'Draws a 2D circle.',
  5. arguments = {
  6. mode = {
  7. type = 'DrawStyle',
  8. description = 'Whether the circle is filled or outlined.'
  9. },
  10. material = {
  11. type = 'Material',
  12. description = 'The Material to apply to the circle.'
  13. },
  14. transform = {
  15. type = 'mat4',
  16. description = 'The circle\'s transform.'
  17. },
  18. x = {
  19. type = 'number',
  20. default = '0',
  21. description = 'The x coordinate of the center of the circle.'
  22. },
  23. y = {
  24. type = 'number',
  25. default = '0',
  26. description = 'The y coordinate of the center of the circle.'
  27. },
  28. z = {
  29. type = 'number',
  30. default = '0',
  31. description = 'The z coordinate of the center of the circle.'
  32. },
  33. radius = {
  34. type = 'number',
  35. default = '1',
  36. description = 'The radius of the circle, in meters.'
  37. },
  38. angle = {
  39. type = 'number',
  40. default = '0',
  41. description = 'The rotation of the circle around its rotation axis, in radians.'
  42. },
  43. ax = {
  44. type = 'number',
  45. default = '0',
  46. description = 'The x coordinate of the circle\'s axis of rotation.'
  47. },
  48. ay = {
  49. type = 'number',
  50. default = '1',
  51. description = 'The y coordinate of the circle\'s axis of rotation.'
  52. },
  53. az = {
  54. type = 'number',
  55. default = '0',
  56. description = 'The z coordinate of the circle\'s axis of rotation.'
  57. },
  58. segments = {
  59. type = 'number',
  60. default = '32',
  61. description = [[
  62. The number of segments to use for the circle geometry. Higher numbers increase smoothness
  63. but increase rendering cost slightly.
  64. ]]
  65. }
  66. },
  67. returns = {},
  68. variants = {
  69. {
  70. arguments = { 'mode', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'segments' },
  71. returns = {}
  72. },
  73. {
  74. arguments = { 'material', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'segments' },
  75. returns = {}
  76. },
  77. {
  78. arguments = { 'mode', 'transform', 'segments' },
  79. returns = {}
  80. },
  81. {
  82. arguments = { 'material', 'transform', 'segments' },
  83. returns = {}
  84. }
  85. },
  86. notes = 'The local normal vector of the circle is `(0, 0, 1)`.',
  87. related = {
  88. 'lovr.graphics.arc'
  89. }
  90. }