CanvasActor
methodKapi.CanvasActor()
Constructor for rendering Actors to a <canvas>
. Extends Kapi.Actor
. Valid options for opt_config
are the same as those for Kapi.Actor
, with the following additions:
- draw (function(CanvasRenderingContext2D, Object)): A function that renders something to a canvas.
Note: context
is inherited from the Kapi
instance if it is not provided here.
Kapi.CanvasActor = function (opt_config) {
Kapi.Actor.call(this, opt_config);
opt_config = opt_config || {};
this.draw = opt_config.draw || noop;
return this;
};
var CanvasActor = Kapi.CanvasActor;
function CanvasActorMethods () {}
CanvasActorMethods.prototype = Kapi.Actor.prototype;
CanvasActor.prototype = new CanvasActorMethods();