paste.lua 1.5 KB

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