Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrTile Class Reference

Tiles are optimized for background tiling. More...

#include <tile.h>

Inheritance diagram for KrTile::

KrImage KrImNode List of all members.

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 KrImNodeClone ()
 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.


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 KrRect   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.

Reimplemented from KrImage.


The documentation for this class was generated from the following file:
Generated on Mon Sep 15 12:01:11 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001