- Main Page
- Classes
- Files
- Directories
- Related Pages

- Class List
- Class Hierarchy
- Class 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:

List of all members.

## Public Member Functions
| 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.
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:

- boxresource.h