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-02-09 01:40:41 +00:00
|
|
|
/**
|
2018-09-28 11:19:21 +00:00
|
|
|
* The Impact Debug component.
|
|
|
|
* Should be applied as a mixin.
|
2018-02-09 01:40:41 +00:00
|
|
|
*
|
|
|
|
* @name Phaser.Physics.Impact.Components.Debug
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
var Debug = {
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [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-02-09 01:40:41 +00:00
|
|
|
*
|
2018-03-18 23:42:09 +00:00
|
|
|
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setDebug: function (showBody, showVelocity, bodyColor)
|
|
|
|
{
|
|
|
|
this.debugShowBody = showBody;
|
|
|
|
this.debugShowVelocity = showVelocity;
|
|
|
|
this.debugBodyColor = bodyColor;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [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-02-09 01:40:41 +00:00
|
|
|
*
|
2018-03-18 23:42:09 +00:00
|
|
|
* @return {Phaser.GameObjects.GameObject} This Game Object.
|
2018-02-09 01:40:41 +00:00
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
setDebugBodyColor: function (value)
|
|
|
|
{
|
|
|
|
this.body.debugBodyColor = value;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Physics.Impact.Components.Debug#debugShowBody
|
2018-03-18 23:42:09 +00:00
|
|
|
* @type {boolean}
|
2018-02-09 01:40:41 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
debugShowBody: {
|
|
|
|
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
return this.body.debugShowBody;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value)
|
|
|
|
{
|
|
|
|
this.body.debugShowBody = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Physics.Impact.Components.Debug#debugShowVelocity
|
2018-03-18 23:42:09 +00:00
|
|
|
* @type {boolean}
|
2018-02-09 01:40:41 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
debugShowVelocity: {
|
|
|
|
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
return this.body.debugShowVelocity;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value)
|
|
|
|
{
|
|
|
|
this.body.debugShowVelocity = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
2018-02-09 01:40:41 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @name Phaser.Physics.Impact.Components.Debug#debugBodyColor
|
2018-03-18 23:42:09 +00:00
|
|
|
* @type {number}
|
2018-02-09 01:40:41 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-11-09 04:02:31 +00:00
|
|
|
debugBodyColor: {
|
|
|
|
|
|
|
|
get: function ()
|
|
|
|
{
|
|
|
|
return this.body.debugBodyColor;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value)
|
|
|
|
{
|
|
|
|
this.body.debugBodyColor = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Debug;
|