Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrBox Class Reference

A Box is sse to create filled or unfilled rectangles, horizontal lines, verticle lines, and crosshairs. More...

#include <box.h>

Inheritance diagram for KrBox::

KrImage KrImNode List of all members.

Public Methods

 KrBox (KrBoxResource *resource)
 Construct from a resource.

virtual KrBox * ToBox ()
 Return a pointer if this is a box.

int Width ()
 Width.

int Height ()
 Height.

void SetSize (int w, int h)
 Set the width and height of this box.

void SetBoxColor (KrRGBA color)
 Set the color of this box.

void SetType (int boxtype)
 Set box type (OUTLINE, FILL, or CROSSHAIR).

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 win)
 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...


Detailed Description

A Box is sse to create filled or unfilled rectangles, horizontal lines, verticle lines, and crosshairs.

(A line is a box with a 1 pixel width or height.)

It can be constructed from a BoxResource, or even without one, depending on which constructor is used. The BoxResource can have multiple colors, but the box is ofter easier to manage without a resource.

The size, color, and type can be changed after construction. (If a multi-color box resource is in use, all but the first color is lost if the size, color, or type is set after construction.)


Member Function Documentation

virtual KrImNode* KrBox::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 KrBox::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