#include <tile.h>
Inheritance diagram for KrTile::
Public Methods | |
void | SetRotation (int rotation) |
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. | |
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(). More... | |
virtual bool | HitTest (int x, int y, int flags, GlDynArray< 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 (KrRect *boundingBox, int window=0) |
Get the bounding box of the image, in its current state. More... | |
virtual KrTile * | ToTile () |
Return a pointer if this is a tile. |
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.
|
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. |
|
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. Reimplemented from KrImage. |