Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrBoxResource Class Reference

A Box is a box of color, a horizontal line, a vertical line, a crosshair, or a rectangle. More...

#include <boxresource.h>

Inheritance diagram for KrBoxResource::

KrResource List of all members.

Public Methods

 KrBoxResource (const std::string &name, int width, int height, const KrRGBA *colorArray, int numColors, int boxtype)
 A box resource is NOT created by a dat file, but is created by the client program. More...

virtual U32 Type ()
 The type of the resource. ( ex, KYRATAG_SPRITE ).

virtual const std::string & TypeName ()
 The name of the type. ( ex, "Sprite" ).

virtual KrBoxResource * ToBoxResource ()
 Return a pointer if this is a box resource.

int Width () const
 Width.

int Height () const
 Height.


Detailed Description

A Box is a box of color, a horizontal line, a vertical line, a crosshair, or a rectangle.

Which seems a bit odd, granted, but from a certain point of view they are all the same thing.


Constructor & Destructor Documentation

KrBoxResource::KrBoxResource const std::string &    name,
int    width,
int    height,
const KrRGBA   colorArray,
int    numColors,
int    boxtype
 

A box resource is NOT created by a dat file, but is created by the client program.

Once a box resource is created (and normally placed in the vault) it is used like any other resource.

Parameters:
width  The width of the box. A width of 1 is a vertical line.
height  The height of the box. A height of 1 is a horizontal line.
colorArray  A box can be made of one or multiple colors. OpenGL mode does not support multiple colors. Only the first color is used in OpenGL rendering.
numColors  The number of colors in the color array. To be drawn correctly for large objects, this needs to be a power of 2 that is 64 or less.
type  OUTLINE, FILL, or CROSSHAIR


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