Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrCanvas Class Reference

A Canvas is a pixel area that a client program can draw to. More...

#include <canvas.h>

Inheritance diagram for KrCanvas::

KrImage KrImNode List of all members.

Public Methods

 KrCanvas (KrCanvasResource *resource)
 Construct from a resource - if the resource changes ALL the instances change.

int Width ()
 Width.

int Height ()
 Height.

KrRGBAPixels ()
 Note that this method is a pass through to a Canvas Resource; if you change the pixel data, all instances of the Canvas Resource will change. More...

void Refresh ()
 Note that this method is a pass through to a Canvas Resource; if you change the Refresh data, all instances of the Canvas Resource will change. More...

virtual KrImNodeClone ()
 Return a copy if this object, not in a Tree(). More...

virtual void QueryBoundingBox (KrRect *boundingBox, int window=0)
 Get the bounding box of the image, in its current state. More...

virtual bool HitTest (int x, int y, int flags, GlDynArray< KrImage *> *results, int window)
 Hit test this object. Returns true if there was a hit, and 'this' will be added to results.

virtual KrCanvas * ToCanvas ()
 Return a pointer if this is a canvas.


Detailed Description

A Canvas is a pixel area that a client program can draw to.

A Canvas has the following advantages over just drawing to the framebuffer after the engine:


Member Function Documentation

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

KrRGBA* KrCanvas::Pixels   [inline]
 

Note that this method is a pass through to a Canvas Resource; if you change the pixel data, all instances of the Canvas Resource will change.

See also:
KrCanvasResource

virtual void KrCanvas::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.

void KrCanvas::Refresh   [inline]
 

Note that this method is a pass through to a Canvas Resource; if you change the Refresh data, all instances of the Canvas Resource will change.

See also:
KrCanvasResource


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