Skip to content

Commit c4a68e3

Browse files
committed
The Debug panel now works in WebGL mode. Pay attention to the warning at the top of the Debug docs (feature request phaserjs#499)
All the Debug methods have had the word 'render' removed from the start. So where you did `debug.renderSpriteInfo` before, it's now just `debug.spriteInfo`. Debug methods that rendered geometry (Rectangle, Circle, Line, Point) have been merged into the single method: `Debug.geom`.
1 parent 418a161 commit c4a68e3

5 files changed

Lines changed: 190 additions & 323 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Significant API changes:
8383
* Time.physicsElapsed is no longer bound or clamped, be wary of this if you use the value anywhere in your code.
8484
* In Group.destroy the default for 'destroyChildren' was false. It's now `true` as this is a far more likely requirement when destroying a Group.
8585
* Game no longer pauses if you've forced orientation and change it, also doesn't resize a NO_SCALE game.
86+
* All the Debug methods have had the word 'render' removed from the start. So where you did `debug.renderSpriteInfo` before, it's now just `debug.spriteInfo`.
87+
* Debug methods that rendered geometry (Rectangle, Circle, Line, Point) have been merged into the single method: `Debug.geom`.
8688

8789

8890
New features:
@@ -132,6 +134,7 @@ New features:
132134
* Group.moveUp(child) will move a child up the display list, swapping with the child above it.
133135
* Group.moveDown(child) will move a child down the display list, swapping with the child below it.
134136
* Device.windowsPhone is now tested for.
137+
* The Debug panel now works in WebGL mode. Pay attention to the warning at the top of the Debug docs (feature request #499)
135138

136139

137140
Updates:

examples/wip/debug.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ var sprite;
1717

1818
function create() {
1919

20-
sprite = game.add.tileSprite(0, 0, 800, 600, 'starfield');
21-
sprite.autoScroll(0, 200);
20+
var tile = game.add.tileSprite(0, 0, 800, 600, 'starfield');
21+
tile.autoScroll(0, 200);
2222

23-
game.add.image(200, 200, 'mummy');
24-
25-
game.world.scale.set(2);
23+
sprite = game.add.image(200, 200, 'mummy');
2624

2725
}
2826

@@ -32,6 +30,6 @@ function update() {
3230

3331
function render() {
3432

35-
game.debug.renderText(sprite.frame, 32, 32);
33+
game.debug.spriteInfo(sprite, 32, 32);
3634

3735
}

src/core/Game.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ Phaser.Game.prototype = {
426426
this.input.boot();
427427
this.sound.boot();
428428
this.state.boot();
429+
this.debug.boot();
429430

430431
this.showDebugHeader();
431432

src/gameobjects/Sprite.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,6 @@ Phaser.Sprite.prototype.preUpdate = function() {
186186
this._cache[1] = this.world.y;
187187
this._cache[2] = this.rotation;
188188
this._cache[4] = 0;
189-
190-
// if (this.body)
191-
// {
192-
// this.body.x = (this.world.x - (this.anchor.x * this.width)) + this.body.offset.x;
193-
// this.body.y = (this.world.y - (this.anchor.y * this.height)) + this.body.offset.y;
194-
// this.body.preX = this.body.x;
195-
// this.body.preY = this.body.y;
196-
// }
197-
198189
return false;
199190
}
200191

0 commit comments

Comments
 (0)