TextureData:paste

Copies a rectangle of pixels from one TextureData to this one.

TextureData:paste(source, x, y, fromX, fromY, width, height)

Arguments

NameTypeDefaultDescription
sourceTextureDataThe TextureData to copy pixels from.
xnumber0The x coordinate to paste to (0-indexed).
ynumber0The y coordinate to paste to (0-indexed).
fromXnumber0The x coordinate in the source to paste from (0-indexed).
fromYnumber0The y coordinate in the source to paste from (0-indexed).
widthnumbersource:getWidth()The width of the region to copy.
heightnumbersource:getHeight()The height of the region to copy.

Returns

Nothing

Notes

The two TextureData must have the same pixel format.

Compressed TextureData cannot be copied.

The rectangle cannot go outside the dimensions of the source or destination textures.

See also