setScissor.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. tag = 'camera',
  3. summary = 'Set the scissor rectangle.',
  4. description = [[
  5. Sets the scissor rectangle. Any pixels outside the scissor rectangle will not be drawn.
  6. ]],
  7. arguments = {
  8. x = {
  9. type = 'number',
  10. description = 'The x coordinate of the upper-left corner of the scissor rectangle.',
  11. },
  12. y = {
  13. type = 'number',
  14. description = 'The y coordinate of the upper-left corner of the scissor rectangle.',
  15. },
  16. w = {
  17. type = 'number',
  18. description = 'The width of the scissor rectangle.',
  19. },
  20. h = {
  21. type = 'number',
  22. description = 'The height of the scissor rectangle.',
  23. }
  24. },
  25. returns = {},
  26. variants = {
  27. {
  28. arguments = { 'x', 'y', 'w', 'h' },
  29. returns = {}
  30. },
  31. {
  32. description = 'Disable the scissor.',
  33. arguments = {},
  34. returns = {}
  35. }
  36. },
  37. notes = [[
  38. The scissor will apply to all draws in a Pass when the pass is submitted, even if this function
  39. is called after adding the draws.
  40. `x` and `y` can not be negative. `w` and `h` must be positive.
  41. By default, the scissor is disabled and will cover the entire render area.
  42. ]],
  43. related = {
  44. 'Pass:getViewport',
  45. 'Pass:setViewport'
  46. }
  47. }