Difference between revisions of "love.graphics.readbackTexture"
m |
m |
||
Line 6: | Line 6: | ||
− | {{notice|This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use this | + | {{notice|This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use this while the game is interactive instead of loading, consider [[love.graphics.readbackTextureAsync]] instead.}} |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === |
Revision as of 21:18, 14 June 2024
Available since LÖVE 12.0 |
It has replaced Canvas:newImageData. |
Generates or updates ImageData from the contents of the given Texture.
Unlike love.graphics.readbackTextureAsync, this will not finish and return until the GPU finishes its own asynchronous work which may take a frame's worth of time or more.
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use this while the game is interactive instead of loading, consider love.graphics.readbackTextureAsync instead. |
Contents
Function
Synopsis
data = love.graphics.readbackTexture( texture )
Arguments
Texture texture
- The Texture to capture.
Returns
ImageData data
- The new ImageData made from the Texture's contents.
Function
Synopsis
data = love.graphics.readbackTexture( texture, mipmap, x, y, width, height, dest, destx, desty )
Arguments
Texture texture
- The Texture to capture.
number slice
- The cubemap face index, array index, or depth layer for cubemap, array, or volume type Textures, respectively. This argument is ignored for regular 2D textures.
number mipmap (1)
- The mipmap index to use, for Textures with mipmaps.
number x
- The x-axis of the top-left corner (in pixels) of the area within the Texture to capture.
number y
- The y-axis of the top-left corner (in pixels) of the area within the Texture to capture.
number width
- The width in pixels of the area within the Texture to capture.
number height
- The height in pixels of the area within the Texture to capture.
ImageData dest (nil)
- Optional existing destination ImageData that will be used instead of creating a new ImageData object.
number destx (0)
- The x-axis of the top-left corner (in pixels) of the area within the destination ImageData to use.
number desty (0)
- The y-axis of the top-left corner (in pixels) of the area within the destination ImageData to use.
Returns
ImageData data
- The new ImageData made from the Texture's contents, or the updated existing ImageData if one was given.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info