Phaser.FrameDebugger = function (game){ this.game = game; this.on = false ; this.skipNext = false ; this.frame = [] ; this.log = [] ; this.count = 0; this.max = 1; this.START = 0; this.STOP = 1; this.CANVAS_CLEAR = 2; this.CANVAS_BLENDMODE = 3; this.CANVAS_MASK_PUSH = 4; this.CANVAS_MASK_POP = 5; this.CANVAS_RENDER_SPRITE = 6; this.CANVAS_RENDER_TEXT = 7; this.CANVAS_RENDER_BITMAPTEXT = 8; this.UPDATE_TEXT = 9; this.CANVAS_DOC_START = 10; this.CANVAS_DOC_STOP = 11; this.CANVAS_SPRITE_BATCH_START = 12; this.CANVAS_SPRITE_BATCH_RENDER_FAST = 13; this.CANVAS_SPRITE_BATCH_RENDER_SLOW = 14; this.CANVAS_SPRITE_BATCH_STOP = 15; this.CANVAS_RENDER_TILING_SPRITE = 16; this.GENERATE_TILING_TEXTURE = 17; this.GRAPHICS_GENERATE_CACHED_SPRITE_SLOW = 18; this.GRAPHICS_GENERATE_CACHED_SPRITE_FAST = 19; this.CANVAS_RENDER_GRAPHICS = 20; this.CANVAS_RENDER_GRAPHICS_CACHED = 21; this.CANVAS_GRAPHICS_START = 22; this.CANVAS_GRAPHICS_STOP = 23; this.CANVAS_GRAPHICS_POLY = 24; this.CANVAS_GRAPHICS_RECT = 25; this.CANVAS_GRAPHICS_CIRCLE = 26; this.CANVAS_GRAPHICS_ELIPSE = 27; this.CANVAS_GRAPHICS_ROUNDED_RECT = 28; } ; Phaser.FrameDebugger.prototype = { start: function (){ this.frame = [{ type: this.START, time: Date.now()} ] ; } , stop: function (){ this.frame.push({ type: this.STOP, time: Date.now()} ); this.log.push(this.frame); this.count++ ; if (this.count === this.max) { this.finish(); } } , cr: function (){ this.frame.push({ type: this.CANVAS_CLEAR} ); } , tu: function (){ this.frame.push({ type: this.UPDATE_TEXT, time: Date.now()} ); } , cts: function (texture, width, height){ this.frame.push({ type: this.CANVAS_RENDER_TILING_SPRITE, texture: texture, width: width, height: height} ); } , gtt: function (texture, width, height){ this.frame.push({ type: this.GENERATE_TILING_TEXTURE, texture: texture, width: width, height: height, time: Date.now()} ); } , cgc: function (){ this.frame.push({ type: this.CANVAS_RENDER_GRAPHICS_CACHED} ); } , cg: function (){ this.frame.push({ type: this.CANVAS_RENDER_GRAPHICS} ); } , rgs: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_START, time: Date.now()} ); } , rgp: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_STOP, time: Date.now()} ); } , cgpoly: function (points){ this.frame.push({ type: this.CANVAS_GRAPHICS_POLY, time: Date.now(), points: points} ); } , cgrect: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_RECT, time: Date.now()} ); } , cgcirc: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_CIRCLE, time: Date.now()} ); } , cgrrect: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_ROUNDED_RECT, time: Date.now()} ); } , cgelip: function (){ this.frame.push({ type: this.CANVAS_GRAPHICS_ELIPSE, time: Date.now()} ); } , cgcs1: function (texture, width, height){ this.frame.push({ type: this.GRAPHICS_GENERATE_CACHED_SPRITE_SLOW, texture: texture, width: width, height: height, time: Date.now()} ); } , cgcs2: function (texture, width, height){ this.frame.push({ type: this.GRAPHICS_GENERATE_CACHED_SPRITE_FAST, texture: texture, width: width, height: height, time: Date.now()} ); } , cb: function (mode){ this.frame.push({ type: this.CANVAS_BLENDMODE, mode: mode} ); } , cdcs: function (){ this.frame.push({ type: this.CANVAS_DOC_START, time: Date.now()} ); } , cdcp: function (){ this.frame.push({ type: this.CANVAS_DOC_STOP, time: Date.now()} ); } , csbs: function (){ this.frame.push({ type: this.CANVAS_SPRITE_BATCH_START, time: Date.now()} ); } , csb1: function (texture, width, height, res){ this.frame.push({ type: this.CANVAS_SPRITE_BATCH_RENDER_FAST, texture: texture, width: width, height: height, resolution: res} ); } , csb2: function (texture, width, height, res){ this.frame.push({ type: this.CANVAS_SPRITE_BATCH_RENDER_SLOW, texture: texture, width: width, height: height, resolution: res} ); } , csbp: function (){ this.frame.push({ type: this.CANVAS_SPRITE_BATCH_STOP, time: Date.now()} ); } , ct: function (texture, width, height, res){ this.frame.push({ type: this.CANVAS_RENDER_TEXT, texture: texture, width: width, height: height, resolution: res} ); this.skipNext = true ; } , cs: function (texture, width, height, res){ if (this.skipNext) { this.skipNext = false ; return ; } this.frame.push({ type: this.CANVAS_RENDER_SPRITE, texture: texture, width: width, height: height, resolution: res} ); } , cm: function (mask){ this.frame.push({ type: this.CANVAS_MASK_PUSH, mask: mask} ); } , cmo: function (){ this.frame.push({ type: this.CANVAS_MASK_POP} ); } , record: function (max){ if (max === undefined) { max = 1; } if (this.on) { return ; } this.reset(); this.on = true ; this.max = 1; } , reset: function (){ this.frame = [] ; this.log = [] ; this.count = 0; this.max = 1; } , finish: function (){ console.log(this.log); this.on = false ; this.win = _AN_Call_open('open', window, 'about:blank', 'FrameDebugger'); var content = '' + '