{{newin (日本語)|[[0.9.2 (日本語)|0.9.2]]|092|type=関数}}
Gets the available [[CanvasFormat|Canvas formats]], and whether each is supported.
== 関数 ==
=== 概要 ===
<source lang="lua">
formats = love.graphics.getCanvasFormats( )
</source>
=== 引数 ===
なし。
=== 返値 ===
{{param (日本語)|table|formats|A table containing [[CanvasFormat]]s as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.}}

== 関数 ==
{{newin (日本語)|[[11.0 (日本語)|11.0]]|110|type=異形}}
=== 概要 ===
<source lang="lua">
formats = love.graphics.getCanvasFormats( readable )
</source>
=== 引数 ===
{{param (日本語)|boolean|readable|If true, the returned formats will only be indicated as supported if [[love.graphics.newCanvas]] will work with the [[Texture:isReadable|readable]] flag set to true for that format, and vice versa if the parameter is false.}}
=== 返値 ===
{{param (日本語)|table|formats|A table containing [[CanvasFormat]]s as keys, and a boolean indicating whether the format is supported as values (taking into account the readable parameter). Not all systems support all formats.}}

== 用例 ==
=== Create a canvas with the format 'rgba16f' if it is supported ===
<source lang="Lua">
local formats = love.graphics.getCanvasFormats()
if formats.rgba16f then
    canvas = love.graphics.newCanvas(800, 600, "rgba16f")
else
    -- The 'rgba16f' format isn't supported. We could have some fallback code, or trigger a message telling the user their system is unsupported.
end
</source>
=== Display a list of the canvas formats on the screen ===
<source lang="Lua">
canvasformats = love.graphics.getCanvasFormats()

function love.draw()
    local y = 0
    for formatname, formatsupported in pairs(canvasformats) do
        local str = string.format("Supports format '%s': %s", formatname, tostring(formatsupported))
        love.graphics.print(str, 10, y)
        y = y + 20
    end
end
</source>
== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[CanvasFormat (日本語)]]
* [[love.graphics.newCanvas (日本語)]]
* [[Canvas (日本語)]]
[[Category:Functions (日本語)]]
{{#set:Sub-Category=SystemInfo (日本語)}}
{{#set:Description=Gets the available [[CanvasFormat|Canvas formats]], and whether each is supported.}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.getCanvasFormats}}