newVec2.lua 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. return {
  2. tag = 'vectors',
  3. summary = 'Create a new Vec2.',
  4. description = 'Creates a new 2D vector. This function takes the same arguments as `Vec2:set`.',
  5. arguments = {
  6. x = {
  7. type = 'number',
  8. default = '0',
  9. description = 'The x value of the vector.'
  10. },
  11. y = {
  12. type = 'number',
  13. default = 'x',
  14. description = 'The y value of the vector.'
  15. },
  16. u = {
  17. type = 'Vec2',
  18. description = 'A vector to copy the values from.'
  19. }
  20. },
  21. returns = {
  22. v = {
  23. type = 'Vec2',
  24. description = 'The new vector.'
  25. }
  26. },
  27. variants = {
  28. {
  29. arguments = { 'x', 'y' },
  30. returns = { 'v' }
  31. },
  32. {
  33. arguments = { 'u' },
  34. returns = { 'v' }
  35. }
  36. },
  37. related = {
  38. 'lovr.math.vec2',
  39. 'Vec2',
  40. 'Vectors'
  41. }
  42. }