paste.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. return {
  2. summary = 'Copy pixels from another Image to this one.',
  3. description = 'Copies a rectangle of pixels from one Image to this one.',
  4. arguments = {
  5. source = {
  6. type = 'Image',
  7. description = 'The Image to copy pixels from.'
  8. },
  9. x = {
  10. type = 'number',
  11. default = '0',
  12. description = 'The x coordinate to paste to (0-indexed).',
  13. },
  14. y = {
  15. type = 'number',
  16. default = '0',
  17. description = 'The y coordinate to paste to (0-indexed).',
  18. },
  19. fromX = {
  20. type = 'number',
  21. default = '0',
  22. description = 'The x coordinate in the source to paste from (0-indexed).',
  23. },
  24. fromY = {
  25. type = 'number',
  26. default = '0',
  27. description = 'The y coordinate in the source to paste from (0-indexed).',
  28. },
  29. width = {
  30. type = 'number',
  31. default = 'source:getWidth()',
  32. description = 'The width of the region to copy.'
  33. },
  34. height = {
  35. type = 'number',
  36. default = 'source:getHeight()',
  37. description = 'The height of the region to copy.'
  38. }
  39. },
  40. returns = {},
  41. variants = {
  42. {
  43. arguments = { 'source', 'x', 'y', 'fromX', 'fromY', 'width', 'height' },
  44. returns = {}
  45. }
  46. },
  47. notes = [[
  48. The two Images must have the same pixel format.
  49. Compressed images cannot be copied.
  50. The rectangle cannot go outside the dimensions of the source or destination textures.
  51. ]],
  52. related = {
  53. 'Image:getPixel',
  54. 'Image:setPixel',
  55. 'Texture:setPixels'
  56. }
  57. }