#include <box.h>
Inheritance diagram for KrBox::
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 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 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... |
(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.)
|
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. |