{{newin (日本語)|[[11.0 (日本語)|11.0]]|110|type=関数}}
Draws a layer of an [[love.graphics.newArrayImage|Array Texture]].

== 関数 ==
Draws a layer of an Array Texture.
=== 概要 ===
<source lang="lua">
love.graphics.drawLayer( texture, layerindex, x, y, r, sx, sy, ox, oy, kx, ky )
</source>
=== 引数 ===
{{param (日本語)|Texture|texture|The Array Texture to draw.}}
{{param (日本語)|number|layerindex|The index of the layer to use when drawing.}}
{{param (日本語)|number|x (0)|The position to draw the texture (x-axis).}}
{{param (日本語)|number|y (0)|The position to draw the texture (y-axis).}}
{{param (日本語)|number|r (0)|Orientation (radians).}}
{{param (日本語)|number|sx (1)|Scale factor (x-axis).}}
{{param (日本語)|number|sy (sx)|Scale factor (y-axis).}}
{{param (日本語)|number|ox (0)|Origin offset (x-axis).}}
{{param (日本語)|number|oy (0)|Origin offset (y-axis).}}
{{param (日本語)|number|kx (0)|Shearing factor (x-axis).}}
{{param (日本語)|number|ky (0)|Shearing factor (y-axis).}}
=== 返値 ===
ありません。

== 関数 ==
Draws a layer of an Array Texture using the specified [[Quad]].
=== 概要 ===
<source lang="lua">
love.graphics.drawLayer( texture, layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )
</source>
=== 引数 ===
{{param (日本語)|Texture|texture|The Array Texture to draw.}}
{{param (日本語)|number|layerindex|The index of the layer to use when drawing.}}
{{param (日本語)|Quad|quad|The subsection of the texture's layer to use when drawing.}}
{{param (日本語)|number|x (0)|The position to draw the texture (x-axis).}}
{{param (日本語)|number|y (0)|The position to draw the texture (y-axis).}}
{{param (日本語)|number|r (0)|Orientation (radians).}}
{{param (日本語)|number|sx (1)|Scale factor (x-axis).}}
{{param (日本語)|number|sy (sx)|Scale factor (y-axis).}}
{{param (日本語)|number|ox (0)|Origin offset (x-axis).}}
{{param (日本語)|number|oy (0)|Origin offset (y-axis).}}
{{param (日本語)|number|kx (0)|Shearing factor (x-axis).}}
{{param (日本語)|number|ky (0)|Shearing factor (y-axis).}}
=== 返値 ===
ありません。
=== 注釈 ===
The specified layer index overrides any layer index set on the Quad via [[Quad:setLayer]].

== 関数 ==
Draws a layer of an Array Texture using the specified [[Transform]].
=== 概要 ===
<source lang="lua">
love.graphics.drawLayer( texture, layerindex, transform )
</source>
=== 引数 ===
{{param (日本語)|Texture|texture|The Array Texture to draw.}}
{{param (日本語)|number|layerindex|The index of the layer to use when drawing.}}
{{param (日本語)|Transform|transform|A transform object.}}
=== 返値 ===
ありません。

== 関数 ==
Draws a layer of an Array Texture using the specified [[Quad]] and [[Transform]].
=== 概要 ===
<source lang="lua">
love.graphics.drawLayer( texture, layerindex, quad, transform )
</source>
=== 引数 ===
{{param (日本語)|Texture|texture|The Array Texture to draw.}}
{{param (日本語)|number|layerindex|The index of the layer to use when drawing.}}
{{param (日本語)|Quad|quad|The subsection of the texture's layer to use when drawing.}}
{{param (日本語)|Transform|transform|A transform object.}}
=== 返値 ===
ありません。
=== 注釈 ===
The specified layer index overrides any layer index set on the Quad via [[Quad:setLayer]].

== 注釈 ==
In order to use an Array Texture or other non-2D texture types as the main texture in a custom [[Shader]], the [[love.graphics.newShader|void effect()]] variant must be used in the pixel shader, and MainTex must be declared as an ArrayImage or sampler2DArray like so: <code>uniform ArrayImage MainTex;</code>.

== 用例 ==
=== Draw multiple layers of an Array Image ===
<source lang="lua">
function love.load()
    local sprites = {"sprite1.png", "sprite2.png"}
    image = love.graphics.newArrayImage(sprites)
end

function love.draw()
    love.graphics.drawLayer(image, 1, 50, 50)
    love.graphics.drawLayer(image, 2, 250, 50)
end
</source>

=== Use a custom shader with love.graphics.drawLayer ===
<source lang="lua">
shader = love.graphics.newShader[[
uniform ArrayImage MainTex;

void effect() {
    // Texel uses a third component of the texture coordinate for the layer index, when an Array Texture is passed in.
    // love sets up the texture coordinates to contain the layer index specified in love.graphics.drawLayer, when
    // rendering the Array Texture.
    love_PixelColor = Texel(MainTex, VaryingTexCoord.xyz) * VaryingColor;
}
]]

function love.load()
    local sprites = {"sprite1.png", "sprite2.png"}
    image = love.graphics.newArrayImage(sprites)
end

function love.draw()
    love.graphics.setShader(shader)
    love.graphics.drawLayer(image, 1, 50, 50)
    love.graphics.drawLayer(image, 2, 250, 50)
end
</source>

== 関連 ==
* [[parent::love.graphics (日本語)]]
* [[love.graphics.newArrayImage (日本語)]]
* [[love.graphics.newCanvas (日本語)]]
* [[love.graphics.newShader (日本語)]]
* [[TextureType (日本語)]]
[[Category:Functions (日本語)]]
[[Sub-Category::Drawing (日本語)| ]]
{{#set:Description=Draws a layer of an [[love.graphics.newArrayImage|Array Texture]].}}
== そのほかの言語 ==
{{i18n (日本語)|love.graphics.drawLayer}}