- Main Page
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# KrTile Class Reference

Tiles are optimized for background tiling. More...

`#include <tile.h>`

Inheritance diagram for KrTile:

List of all members.

## Public Types
enum | eROTATION
| A tile has 8 rotations, as follows: 0: no rotation 1: 90 CW 2: 180 CW 3: 270 CW 4: no rotation then flipped around a horizontal line 5: 90 CW then flipped around a horizontal line 6: 180 CW then flipped around a horizontal line 7: 270 CW then flipped around a horizontal line.
## Public Member Functions
int | Size () const
| Tiles are always square. Returns the size of any edge.
virtual KrImNode * | Clone ()
| Return a copy if this object, not in a Tree().
virtual bool | HitTest (int x, int y, int flags, std::vector< KrImage * > *results, int window)
| Hit test this object. Returns true if there was a hit, and 'this' will be added to results.
virtual void | QueryBoundingBox (grinliz::Rectangle2I *boundingBox, int window=0)
| Get the bounding box of the image, in its current state.
virtual KrTile * | ToTile ()
| Return a pointer if this is a tile.

## Detailed Description

Tiles are optimized for background tiling.

The have to be square, and can be rotated and flipped into all 8 configurations.

They support alpha but are not optimized for it.

The rotational properties of Tiles are very useful for some applications that use the Tiles for backgrounds. Tiles are good for creating backgrounds and can be very efficient. However, if you find yourself thinking that you could use a Sprite or a Tile, use the Sprite. They are much more flexible.

Tiles don't collide, and only scale if cached.

## Member Function Documentation

virtual KrImNode* KrTile::Clone | ( |  | ) | `[virtual]`

Return a copy if this object, not in a Tree().

It is return untransformed. In the case of a sprite, the action and frame will be set to the current value.

Reimplemented from KrImNode.

virtual void KrTile::QueryBoundingBox | ( | grinliz::Rectangle2I * | boundingBox,
|  | int | window = `0` |
| ) |  |  | `[virtual]`

Get the bounding box of the image, in its current state.

If this is a sprite, it will be the bounding box of the current frame and action. The bounds are relative to the hotspot, so xmin and ymin will often be not zero.

The current transformation matrix will be applied, so the result may be transformed bounds.

Implements KrImage.

The documentation for this class was generated from the following file:

- tile.h