#include <canvas.h>
Inheritance diagram for KrCanvas::
Public Methods | |
KrCanvas (KrCanvasResource *resource) | |
Construct from a resource - if the resource changes ALL the instances change. | |
int | Width () |
Width. | |
int | Height () |
Height. | |
KrRGBA * | Pixels () |
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 KrImNode * | Clone () |
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. |
A Canvas has the following advantages over just drawing to the framebuffer after the engine:
|
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. |
|
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.
|
|
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. |
|
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.
|