Difference between revisions of "SpriteBatch:setLayer"

m
m (See Also: typo.)
 
Line 78: Line 78:
 
== See Also ==
 
== See Also ==
 
* [[parent::SpriteBatch]]
 
* [[parent::SpriteBatch]]
* [[SpriteBatch:setLayer]]
+
* [[SpriteBatch:addLayer]]
 
* [[love.graphics.newArrayImage]]
 
* [[love.graphics.newArrayImage]]
 
* [[love.graphics.newCanvas]]
 
* [[love.graphics.newCanvas]]
Line 85: Line 85:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Changes a sprite previously added with [[SpriteBatch:add|add]] or [[SpriteBatch:addLayer|addLayer]], in a batch created with an [[TextureType|Array Texture]].}}
 
{{#set:Description=Changes a sprite previously added with [[SpriteBatch:add|add]] or [[SpriteBatch:addLayer|addLayer]], in a batch created with an [[TextureType|Array Texture]].}}
 +
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|SpriteBatch:setLayer}}
 
{{i18n|SpriteBatch:setLayer}}

Latest revision as of 15:03, 24 July 2019

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

Changes a sprite previously added with add or addLayer, in a batch created with an Array Texture.

Function

Changes the sprite in the SpriteBatch.

Synopsis

SpriteBatch:setLayer( spriteindex, layerindex, x, y, r, sx, sy, ox, oy, kx, ky )

Arguments

number spriteindex
The index of the existing sprite to replace.
number layerindex
The index of the layer in the Array Texture to use for this sprite.
number x (0)
The position to draw the sprite (x-axis).
number y (0)
The position to draw the sprite (y-axis).
number r (0)
Orientation (radians).
number sx (1)
Scale factor (x-axis).
number sy (sx)
Scale factor (y-axis).
number ox (0)
Origin offset (x-axis).
number oy (0)
Origin offset (y-axis).
number kx (0)
Shearing factor (x-axis).
number ky (0)
Shearing factor (y-axis).

Returns

Nothing.

Function

Adds a layer of the SpriteBatch's Array Texture using the specified Quad.

Synopsis

SpriteBatch:setLayer( spriteindex, layerindex, quad, x, y, r, sx, sy, ox, oy, kx, ky )

Arguments

number spriteindex
The index of the existing sprite to replace.
number layerindex
The index of the layer to use for this sprite.
Quad quad
The subsection of the texture's layer to use when drawing the sprite.
number x (0)
The position to draw the sprite (x-axis).
number y (0)
The position to draw the sprite (y-axis).
number r (0)
Orientation (radians).
number sx (1)
Scale factor (x-axis).
number sy (sx)
Scale factor (y-axis).
number ox (0)
Origin offset (x-axis).
number oy (0)
Origin offset (y-axis).
number kx (0)
Shearing factor (x-axis).
number ky (0)
Shearing factor (y-axis).

Returns

Nothing.

Notes

The specified layer index overrides any layer index set on the Quad via Quad:setLayer.

Function

Adds a layer of the SpriteBatch's Array Texture using the specified Transform.

Synopsis

SpriteBatch:setLayer( spriteindex, layerindex, transform )

Arguments

number spriteindex
The index of the existing sprite to replace.
number layerindex
The index of the layer to use for the sprite.
Transform transform
A transform object.

Returns

Nothing.

Function

Adds a layer of the SpriteBatch's Array Texture using the specified Quad and Transform.

Synopsis

SpriteBatch:setLayer( spriteindex, layerindex, quad, transform )

Arguments

number spriteindex
The index of the existing sprite to replace.
number layerindex
The index of the layer to use for the sprite.
Quad quad
The subsection of the texture's layer to use when drawing the sprite.
Transform transform
A transform object.

Returns

Nothing.

Notes

The specified layer index overrides any layer index set on the Quad via Quad:setLayer.

See Also


Other Languages