Introduction
The Wrap value controls whether the sprite will wrap its image when rendering portions beyond the image location. If this value is true then wrapping will occur. Otherwise, areas beyond the texture will extend the last pixel - also known as "clamping" the value.
The Wrap variable applies when dealing with a Texture Address of Custom or DimensionsBased.
The texture address property controls the texture address behavior of a sprite. Specifically it can control whether texture addresses variables are available, and how texture coordinates and sprite size relate.
If the texture address property is set to EntireTexture then the sprite will draw its full image. The sprite will not repeat this texture or render only part of the texture.
If the texture address property is set to Custom then the top, bottom, left, and right properties can be independently set. This allows a sprite to only render a portion of its source texture.
Typically a Texture Address of Custom is used in combination with a Width Units of Percent of File Width and and a Height Units of Percent of File Height. In this case, the size of the sprite depends on the texture coordinates.
If the Texture Address property is set to DimensionsBased then the texture coordinates will adjust internally according to the width and the height of the Sprite. In other words, making the sprite larger or smaller will not stretch the image that it is rendering. Instead the image will be clipped, or clamped/wrapped according to the Wrap property.
Combining the DimensionsBased texture address with the wrap property will let you easily create tiling sprites.
The Color value is used to perform a multiply color operation on the sprite. Color values can be used to darken or tint a grayscale texture. By default Sprites us a white color, which means the original texture will display unmodified.
The following images show the color values as applied to a multi-color sprite.
Red: 255 Green: 255 Blue: 255
Red: 255 Green: 0 Blue: 0
Red: 0 Green: 255 Blue: 0
Red: 0 Green: 0 Blue: 255
Red: 128 Green: 128 Blue: 128
Red: 0 Green: 0 Blue: 0
The Source File property determines the file that is used by the Sprite. Sprite Source Files support the following formats:
.png files
.achx files (AnimationChains)
Images from URLs
If a Sprite has an empty Source File or if it references a missing file, then the missing file texture is displayed.
Source File can be set by typing a value or using the ... button to browser for a file.
All files are added as paths relative to the .gumx project.
If a file is referenced outside of the .gumx folder, then Gum asks if you would like to copy the file or reference it outside of the current directory. Usually files should be copied to the project folder to keep the entire Gum proejct portable.
Gum natively supports referencing Animation Chain XML files (.achx) which are created by the FlatRedBall AnimationEditor. For more information on creating .achx files, see the FlatRedBall AnimationEditor page.
Once you have created an .achx file, you can reference it the same as a .png by entering its name or selecting it with the ... button.
When referencing an .achx file, be sure to also check the Animate checkbox and to select the Current Chain Name.
.achx files are XML files which reference one or more other PNG files. If you are moving an .achx file be sure to also move the referenced PNG files.
Gum Sprites can also reference URLs. Gum can display images from URLs with standard file extensions such as .png and .jpg
Sprites can also reference images without extensions, such as urls from https://picsum.photos/