Difference between revisions of "(Image):setWrap"

m (better phrasing)
(update for 0.6.2)
Line 1: Line 1:
 
Sets the wrapping properties of an Image.
 
Sets the wrapping properties of an Image.
  
This function sets the way an Image is repeated when it is drawn with a [[Quad| Quad]] that is larger than the image's extent. The parameters may either be 0, which indicates no repeating is to appear in the corresponding direction, or 1, which indicate the image should repeat to fill the Quad.
+
This function sets the way an Image is repeated when it is drawn with a [[Quad| 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 setWrap to tile the image, you may get an unwanted visual effect of the image stretching all the way to fill the Quad anyway. If this is the case, just set <tt>Image:getWrap(1, 1)</tt> for all the images you want to repeat, and use Quad size to limit the image to the desired dimensions.
+
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:getWrap("repeat", "repeat")</tt> for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Image:getWrap( horiz, vert )
+
Image:setWrap( horiz, vert )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|horiz|Horizontal wrapping mode of the image.}}
+
{{param|WrapMode|horiz|Horizontal wrapping mode of the image.}}
{{param|number|vert|Vertical wrapping mode of the image.}}
+
{{param|WrapMode|vert|Vertical wrapping mode of the image.}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 
== See Also ==
 
== See Also ==
 
* [[parent::Image]]
 
* [[parent::Image]]
 +
* [[WrapMode]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets the wrapping properties of an Image.}}
 
{{#set:Description=Sets the wrapping properties of an Image.}}

Revision as of 12:23, 6 March 2010

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:getWrap("repeat", "repeat") for all the images to be repeated, and using Quads of appropriate size will result in the best visual appearance.

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