Difference between revisions of "(Image):setWrap"

m
m
Line 5: Line 5:
 
N.B. If you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting <tt>Image:setWrap("repeat", "repeat")</tt> for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.
 
N.B. If you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting <tt>Image:setWrap("repeat", "repeat")</tt> for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.
  
{{notice|On *very* old graphics cards that don't support OpenGL 2.0, the wrapping results may be different for images with non-power-of-two sizes, because LÖVE will internally pad the image to the next power-of-two dimensions in that case.}}
+
{{notice|On *very* old graphics cards that don't support OpenGL 2.0, the wrapping results may be different for images with [[PO2_Syndrome|non-power-of-two sizes]], because LÖVE will internally pad the image to the next power-of-two dimensions in that case.}}
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Revision as of 23:10, 15 October 2015

Sets the wrapping properties of an Image.

This function sets the way an Image is repeated when it is drawn with a Quad that is larger than the image's extent. An image may be clamped or set to repeat in both horizontal and vertical directions. Clamped images appear only once, but repeated ones repeat as many times as there is room in the Quad.

N.B. If you use a Quad that is larger than the image extent and do not use repeated tiling, there may be an unwanted visual effect of the image stretching all the way to fill the Quad. If this is the case, setting Image:setWrap("repeat", "repeat") for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.

O.png On *very* old graphics cards that don't support OpenGL 2.0, the wrapping results may be different for images with non-power-of-two sizes, because LÖVE will internally pad the image to the next power-of-two dimensions in that case.  


Function

Synopsis

Image:setWrap( horiz, vert )

Arguments

WrapMode horiz
Horizontal wrapping mode of the image.
WrapMode vert
Vertical wrapping mode of the image.

Returns

Nothing.

See Also


Other Languages