phaser/plugins/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>
2020-01-15 12:07:09 +00:00
* @copyright 2020 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
/**
2018-09-28 11:19:21 +00:00
* The Impact Debug component.
* Should be applied as a mixin.
*
* @namespace 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;