Difference between revisions of "love.image.newCompressedData"

(Created page)
 
 
Line 1: Line 1:
 
{{newin|[[0.9.0]]|090|type=function}}
 
{{newin|[[0.9.0]]|090|type=function}}
Create a new [[CompressedData]] object from a compressed image file. LÖVE currently supports DDS files compressed with the DXT1, DXT5, and BC5 / 3Dc formats.
+
Create a new [[CompressedImageData]] object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the [[CompressedImageFormat]] page.
 
{{newobjectnotice}}
 
{{newobjectnotice}}
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
compressedData = love.image.newCompressedData( filename )
+
compressedImageData = love.image.newCompressedData( filename )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
{{param|string|filename|The filename of the compressed image file.}}
 
{{param|string|filename|The filename of the compressed image file.}}
 
=== Returns ===
 
=== Returns ===
{{param|CompressedData|compressedData|The new CompressedData object.}}
+
{{param|CompressedImageData|compressedImageData|The new CompressedImageData object.}}
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
compressedData = love.image.newCompressedData( fileData )
+
compressedImageData = love.image.newCompressedData( fileData )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
 
{{param|FileData|fileData|A FileData containing a compressed image.}}
 
{{param|FileData|fileData|A FileData containing a compressed image.}}
 
=== Returns ===
 
=== Returns ===
{{param|CompressedData|compressedData|The new CompressedData object.}}
+
{{param|CompressedImageData|compressedImageData|The new CompressedImageData object.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.image]]
 
* [[parent::love.image]]
 
* [[love.image.isCompressed]]
 
* [[love.image.isCompressed]]
 
* [[love.graphics.newImage]]
 
* [[love.graphics.newImage]]
* [[Constructs::CompressedData]]
+
* [[Constructs::CompressedImageData]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Create a new [[CompressedData]] object from a compressed image file.}}
+
{{#set:Description=Create a new [[CompressedImageData]] object from a compressed image file.}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.image.newCompressedData}}
 
{{i18n|love.image.newCompressedData}}

Latest revision as of 03:34, 3 October 2015

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Create a new CompressedImageData object from a compressed image file. LÖVE supports several compressed texture formats, enumerated in the CompressedImageFormat page.

O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!  



Function

Synopsis

compressedImageData = love.image.newCompressedData( filename )

Arguments

string filename
The filename of the compressed image file.

Returns

CompressedImageData compressedImageData
The new CompressedImageData object.

Function

Synopsis

compressedImageData = love.image.newCompressedData( fileData )

Arguments

FileData fileData
A FileData containing a compressed image.

Returns

CompressedImageData compressedImageData
The new CompressedImageData object.

See Also

Other Languages