HorizontalResizeImage

The HorizontalResizeImage allows you to create an image that will automatically resize to fit a window of any width.

Summary
HorizontalResizeImageThe HorizontalResizeImage allows you to create an image that will automatically resize to fit a window of any width.
Implementation DetailsThe HorizontalImage requires a set of texture coordinates to specify the different portions of the image.
XML DefinitionThis is the HorizontalResizeImage xml definition.
XML Tag
Required AttributesRequired for the window element to create itself properly.
textureName of the Ui Texture to use to create the tiled image..
Optional AttributesThese are optional.
textureScaleThe scale of the texture to be used for the image artwork.
reverseFillWhen set, the image will tile from right to left, rather than left to right.
Required Elements
SizesThe dimensions in the texture for each tillable component of the image.
TexCoordsThe texture coordinates for each component of the tile-able image.
TexSlicesThe texture slice references for each component of the tile-able image.
FunctionsThe HorizontalResizeImage must be defined entirely in XML and does not have any run-time functions.

Implementation Details

The HorizontalImage requires a set of texture coordinates to specify the different portions of the image.

These are defined by the Sizes and TexCoords elements.  See the following illustration for an example of how to determine the correct values.  The texture shown on the left is used to top frame to the windows on the right.

XML Definition

This is the HorizontalResizeImage xml definition.

Summary
XML Tag
Required AttributesRequired for the window element to create itself properly.
textureName of the Ui Texture to use to create the tiled image..
Optional AttributesThese are optional.
textureScaleThe scale of the texture to be used for the image artwork.
reverseFillWhen set, the image will tile from right to left, rather than left to right.
Required Elements
SizesThe dimensions in the texture for each tillable component of the image.
TexCoordsThe texture coordinates for each component of the tile-able image.
TexSlicesThe texture slice references for each component of the tile-able image.

XML Tag

<HorizontalResizeImage>
....
</HorizontalResizeImage>

Required Attributes

Required for the window element to create itself properly.

texture

Name of the Ui Texture to use to create the tiled image..

Expects

A string value, which is the name of a valid ui Texture.

Default Value

  • ””

Optional Attributes

These are optional.  You can use whichever apply to the HorizontalResizeImage you are creating.

textureScale

The scale of the texture to be used for the image artwork.  This is multiplied by the image’s <Size> to determine the texture dimensions.

Expects

A number value.  (1.0 = 100%)

Default Value

  • 1.0

reverseFill

When set, the image will tile from right to left, rather than left to right.

Expects

A boolean value.

”true”Tile right->left.
”false”Tile left->right.

Default Value

  • ”false”

Required Elements

Sizes

The dimensions in the texture for each tillable component of the image.

Syntax

<Sizes left="10" middle="316" right="10" />
leftThe pixel width of the left end of the image.  This is not resized.
middleThe pixel width of the middle tilable portion of the image.
rightThe pixel width of the right end of the image.  This is not resized.

Defaults

left0
middle0
right0

Notes

  • The pixel height is taken from the window’s <Size> element.  All instances of a HorizontalResizeImage should use a height value equivalent to the size of the artwork.  If the height changes, the image will not tile or shrink vertically.  If you need this, use a FullResizeImage defintion instead.
  • The left and right values may be 0 if you do not wish to have static ends on your image.

TexCoords

The texture coordinates for each component of the tile-able image.

Syntax

<TexCoords>
<Left x="120" y="604" />
<Middle x="130" y="604" />
<Right x="328" y="604" />
</TexCoords>
LeftThe top left corner of the image.  (not tiled).
MiddleThe coordinate used for the tile-able center of the image.
RightThe top right corner of the image.  (not tiled).

Defaults

For all coordinates...

x0
y0

Notes

  • The middle coordinates are REQUIRED.  The left/left are optional if you do not wish to include a border on your image.

TexSlices

The texture slice references for each component of the tile-able image.

Syntax

<TexSlices>
<Left id="LeftSlice" />
<Middle id="MiddleSlice" />
<Right id="RightSlice" />
</TexSlices>
LeftThe top left corner of the image.  (not tiled).
MiddleThe coordinate used for the tile-able center of the image.
RightThe top right corner of the image.  (not tiled).

Defaults

For all slices...

id = “”

Notes

  • One of a middle slice or middle texture coordinate is REQUIRED.  The left/left are optional if you do not wish to include a border on your image.

Functions

The HorizontalResizeImage must be defined entirely in XML and does not have any run-time functions.

This element defines a single art texture component.
The dimensions in the texture for each tillable component of the image.
The texture coordinates for each component of the tile-able image.
The FullResizeImage allows you to create automatically tiling images to produce backgrounds and frame.