Type Function Library graphics.* Return value TextureResource Revision 2017.3060 Keywords textures, performance optimization, texture memory, images See also texture:releaseSelf() graphics.newTexture() Texture Loading/Management (guide) TextureResource
This convenience function disposes/releases all TextureResource objects of a specific type.
graphics.releaseTextures( params )
Table. Table containing the parameters for the TextureResource object(s) to be released — see the next section for details.
String. The type of the texture object(s) to dispose/release. If this parameter is omitted, all texture resource objects will be released.
"image" — Releases all TextureResource objects of type TextureResourceBitmap.
"canvas" — Releases all TextureResource objects of type TextureResourceCanvas.
-- Create "TextureResource" object of type "TextureResourceBitmap"
local backgroundTexture = graphics.newTexture( { type="image", filename="background.png" } )
-- Sometime later, release all texture objects of a specific type
graphics.releaseTextures( { type="image" } )