Difference between revisions of "love.graphics.getImageFormats"

m
m (0.11.0 -> 11.0)
 
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
 
Gets the raw and compressed [[PixelFormat|pixel formats]] usable for [[Image]]s, and whether each is supported.
 
Gets the raw and compressed [[PixelFormat|pixel formats]] usable for [[Image]]s, and whether each is supported.
 
== Function ==
 
== Function ==

Latest revision as of 12:43, 29 December 2018

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

Gets the raw and compressed pixel formats usable for Images, and whether each is supported.

Function

Synopsis

formats = love.graphics.getImageFormats( )

Arguments

None.

Returns

table formats
A table containing PixelFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.

Examples

Display a list of the raw and compressed pixel formats usable with Images on the screen

formats = love.graphics.getImageFormats()

function love.draw()
    local y = 0
    for formatname, formatsupported in pairs(formats) do
        local str = string.format("Supports format '%s': %s", formatname, tostring(formatsupported))
        love.graphics.print(str, 10, y)
        y = y + 20
    end
end

See Also


Other Languages