mirror of
https://github.com/wassname/phaser.git
synced 2026-08-20 12:40:12 +08:00
Added Debug.renderSpriteBounds() back and wrapped Body.velocity and force in px2p calls.
This commit is contained in:
@@ -350,6 +350,21 @@ Phaser.Utils.Debug.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the Sprites bounds. Note: This is really expensive as it has to calculate the bounds every time you call it!
|
||||
* @method Phaser.Utils.Debug#renderSpriteBounds
|
||||
* @param {Phaser.Sprite} sprite - Description.
|
||||
* @param {string} [color] - Color of the debug info to be rendered (format is css color string).
|
||||
* @param {boolean} [filled=true] - Render the rectangle as a fillRect (default, true) or a strokeRect (false)
|
||||
*/
|
||||
renderSpriteBounds: function (sprite, color, filled) {
|
||||
|
||||
var bounds = sprite.getBounds();
|
||||
|
||||
this.renderRectangle(bounds, color, filled);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Render debug infos (including name, bounds info, position and some other properties) about the Sprite.
|
||||
* @method Phaser.Utils.Debug#renderSpriteInfo
|
||||
|
||||
Reference in New Issue
Block a user