Unigine::WidgetSprite Class

This base class is used to create sprites, which are basically any widgets dealing with images.

A sprite has a background layer which is used to calculate a bounding box of the widget and in addition can have a number of layers. All layer including the bottom one can be assigned textures, tiled and blended.

Notice

You can transform all layers, but avoid rotating a background layer. Being used to calculate a BB, it stretches if rotated. Rotate layers instead.

Return value

Sets a loaded into memory image for the first (bottom) layer of the sprite. This layer always exists in the sprite. An additional flag can be set in case the sprite image is going to be updated often or even each frame (for optimized memory management).

Arguments

const Ptr<Image> &image - Pointer to the image.

intdynamic - Positive number if the image will be updated each frame; otherwise, 0.

Return value

Sets texture tiling for the first (bottom) layer of the sprite. This layer always exists in the sprite. The default is 0 (no tiling). To see tiling in effect, you need to transform sprite texture coordinates via setTexCoord().