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

- Class List
- Class Hierarchy
- Class Members

# KrResource Class Reference

The KrImNode's children - Sprite, Canvas, etc - are instances of corresponding resources. More...

`#include <kyraresource.h>`

Inheritance diagram for KrResource:

List of all members.

## Public Member Functions
virtual U32 | Type ()=0
| The type of the resource. ( ex, KYRATAG_SPRITE ).
virtual const std::string & | TypeName ()=0
| The name of the type. ( ex, "Sprite" ).
const std::string & | ResourceName ()
| A unique name for this particular resource. ( "Warrior" ).
const U32 | ResourceId ()
| A unique id for this resource. (BEM_WARRIOR).
virtual KrSpriteResource * | ToSpriteResource ()
| Return a pointer if this is a sprite resource.
virtual KrTileResource * | ToTileResource ()
| Return a pointer if this is a tile resource.
virtual KrCanvasResource * | ToCanvasResource ()
| Return a pointer if this is a canvas resource.
virtual KrFontResource * | ToFontResource ()
| Return a pointer if this is a font resource.
virtual KrBoxResource * | ToBoxResource ()
| Return a pointer if this is a box resource.
virtual KrTextDataResource * | ToTextDataResource ()
| Return a pointer if this is a text data resource.
virtual KrBinaryDataResource * | ToBinaryDataResource ()
| Return a pointer if this is a binary data resource.
virtual void | CacheScale (GlFixed xScale, GlFixed yScale)
| Create a cached resourced.
virtual bool | IsScaleCached (GlFixed xScale, GlFixed yScale)
| Check the cache for a given scale.
virtual void | FreeScaleCache ()
| Free up the cache.

## Detailed Description

The KrImNode's children - Sprite, Canvas, etc - are instances of corresponding resources.

KrResource is the parent class for all resources.

## Member Function Documentation

virtual void KrResource::CacheScale | ( | GlFixed | xScale,
|  | GlFixed | yScale |
| ) |  |  | `[inline, virtual]`

Create a cached resourced.

A resource can be drawn much more quickly if its scaled image is pre-calculated. This generates and scaled version of the resource and stores it for fast drawing. The cached version will always be used before a version generated on the fly.

Reimplemented in KrCanvasResource, KrSpriteResource, and KrTileResource.

The documentation for this class was generated from the following file:

- kyraresource.h