phaser/src/physics/impact/components/Debug.js

120 lines
2.4 KiB
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2019-01-15 16:20:22 +00:00
* @copyright 2019 Photon Storm Ltd.
2018-02-12 16:01:20 +00:00
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
2018-09-28 11:19:21 +00:00
* The Impact Debug component.
* Should be applied as a mixin.
*
* @name Phaser.Physics.Impact.Components.Debug
* @since 3.0.0
*/
var Debug = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Debug#setDebug
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {boolean} showBody - [description]
* @param {boolean} showVelocity - [description]
* @param {number} bodyColor - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebug: function (showBody, showVelocity, bodyColor)
{
this.debugShowBody = showBody;
this.debugShowVelocity = showVelocity;
this.debugBodyColor = bodyColor;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Debug#setDebugBodyColor
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} value - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setDebugBodyColor: function (value)
{
this.body.debugBodyColor = value;
return this;
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowBody
2018-03-18 23:42:09 +00:00
* @type {boolean}
* @since 3.0.0
*/
debugShowBody: {
get: function ()
{
return this.body.debugShowBody;
},
set: function (value)
{
this.body.debugShowBody = value;
}
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity
2018-03-18 23:42:09 +00:00
* @type {boolean}
* @since 3.0.0
*/
debugShowVelocity: {
get: function ()
{
return this.body.debugShowVelocity;
},
set: function (value)
{
this.body.debugShowVelocity = value;
}
},
/**
* [description]
*
* @name Phaser.Physics.Impact.Components.Debug#debugBodyColor
2018-03-18 23:42:09 +00:00
* @type {number}
* @since 3.0.0
*/
debugBodyColor: {
get: function ()
{
return this.body.debugBodyColor;
},
set: function (value)
{
this.body.debugBodyColor = value;
}
}
};
module.exports = Debug;