easeljs: add Stage to Ticker.addEventListener

Stage is supported as an eventListener for convenience.  For example:

    createjs.Ticker.addEventListener("tick", stage);

See http://www.createjs.com/Docs/EaselJS/classes/Ticker.html
This commit is contained in:
Joe Schafer
2014-11-19 23:04:18 -05:00
parent 746e44e819
commit 963fa11a66
2 changed files with 7 additions and 0 deletions

View File

@@ -65,4 +65,10 @@ function colorMatrixTest() {
];
shape.cache(-50, -50, 100, 100);
}
function test_canvas_tick() {
var canvas = <HTMLCanvasElement>document.getElementById('canvas');
var stage = new createjs.Stage(canvas);
var stage = createjs.Ticker.addEventListener("tick", stage);
}

View File

@@ -728,6 +728,7 @@ declare module createjs {
static setPaused(value: boolean): void;
// EventDispatcher mixins
static addEventListener(type: string, listener: Stage, useCapture?: boolean): Stage;
static addEventListener(type: string, listener: (eventObj: Object) => boolean, useCapture?: boolean): Function;
static addEventListener(type: string, listener: (eventObj: Object) => void, useCapture?: boolean): Function;
static addEventListener(type: string, listener: { handleEvent: (eventObj: Object) => boolean; }, useCapture?: boolean): Object;