Difference between revisions of "WrapMode"

m (Notes)
(Use the feature templates)
Line 5: Line 5:
 
;clamp: Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.
 
;clamp: Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.
 
;repeat: Repeat the texture. Fills the whole available extent.
 
;repeat: Repeat the texture. Fills the whole available extent.
{{newin|[[0.9.2]]|092|type=constant}}
+
{{New feature|0.9.2|
;mirroredrepeat: Repeat the texture, flipping it each time it repeats. May produce better visual results than the <code>repeat</code> mode when the texture doesn't seamlessly tile.
+
;mirroredrepeat: Repeat the texture, flipping it each time it repeats. May produce better visual results than the <code>repeat</code> mode when the texture doesn't seamlessly tile.}}
{{newin|[[0.10.0]]|100|type=constant}}
+
{{New feature|0.10.0|
;clampzero: Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)
+
;clampzero: Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)}}
  
 
== Notes ==
 
== Notes ==

Revision as of 15:48, 16 May 2016

How the image wraps inside a Quad with a larger quad size than image size. This also affects how Meshes with texture coordinates which are outside the range of [0, 1] are drawn, and the color returned by the Texel Shader function when using it to sample from texture coordinates outside of the range of [0, 1].

ComparisonWraps.png

Constants

clamp
Clamp the texture. Appears only once. The area outside the texture's normal range is colored based on the edge pixels of the texture.
repeat
Repeat the texture. Fills the whole available extent.
Available since LÖVE 0.9.2
mirroredrepeat
Repeat the texture, flipping it each time it repeats. May produce better visual results than the repeat mode when the texture doesn't seamlessly tile.


Available since LÖVE 0.10.0
clampzero
Clamp the texture. Fills the area outside the texture's normal range with transparent black (or opaque black for textures with no alpha channel.)


Notes

The clampzero mode is not available on most mobile devices, and will fall back to the clamp mode when it's unsupported. Check the clampzero GraphicsFeature constant by calling love.graphics.getSupported.

See Also


Other Languages