The Wrap value controls whether the sprite wraps its image when rendering portions beyond the right and bottom image bounds. If this value is true then wrapping occurs. Otherwise, areas beyond the texture extend the last pixel - also known as "clamping" the value.
The Wrap variable applies when dealing with a Texture Address of Custom or DimensionsBased. Wrapping is not available when using a Texture Address value of Entire Texture.
Wrap and Custom Texture Address
If Texture Address is set to Custom then wrapping is available. All examples in the Custom Texture Address section use the following values:
Default Sprite width and height values are used in this section
Toggling wrapping adjusts whether the Sprite wraps or clamps the area defined by the Texture Left, Texture Top, Texture Width, and Texture Height values.
A Sprite can wrap or clamp the area outside of the right and bottom bounds of its source
A texture is wrapped if its Texture Right or Texture Bottom values are set to be larger than the source texture. For example, the following image shows a Sprite which is using an image that is 200x200. Its Texture Width is set to 500 and Texture Height is set to 300 so the sprite displays wrapping.
Sprite wrapping its image
If the Texture Width or Texture Height values are adjusted, then the Sprite's wrapping also adjusts.
Adjusting Texture Width and Texture Heigh changes wrapping
If Wrap is set to true, then wrapping happens for any area to the right or bottom of the bounds of the source. The following shows the bounds of a sprite moved in the Texture Coordinate tab resulting in the area that is being displayed wrapping and repeating.
Sprite repeating the image as its texture address is moved to the right
If a Sprite's Texture Left or Texture Top are set to less than 0 then the Sprite clamps this area. This may change to wrap in future versions of Gum so this behavior should not be relied upon.
Wrap and DimensionsBased
If a Sprite sets DimensionsBased for its Texture Address, then its source file can wrap if its dimensions are large enough to result in the texture width or texture height set to a value larger than the source dimensions.
All examples in the DimensionsBased Texture Address section use the following values:
Width Units = Absolute
Height Units = Absolute
Sprite width and height values used in this section
Toggling wrapping adjusts whether the Sprite wraps or clamps the area defined by the Texture Left, Texture Top, and its size.
A Sprite can wrap or clamp the area outside of the right and bottom bounds of its source
If a Sprite's width or height are adjusted, this results in its texture coordinate values also being modified. If Wrap is true then areas outside of the source file wrap.
The source image wraps if the width or height are adjusted Texture Address is DimensionsBased
Wrapping can also be affected by changing the Texture Width Scale or Texture Height Scale. Smaller values result in image being drawn smaller, making it wrap more.