phaser/plugins/impact/components/Friction.js

72 lines
1.5 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 Friction component.
* Should be applied as a mixin.
*
* @namespace Phaser.Physics.Impact.Components.Friction
* @since 3.0.0
*/
2017-08-17 02:48:39 +00:00
var Friction = {
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFrictionX
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} x - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-17 02:48:39 +00:00
setFrictionX: function (x)
{
this.friction.x = x;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFrictionY
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} y - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-17 02:48:39 +00:00
setFrictionY: function (y)
{
this.friction.y = y;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Impact.Components.Friction#setFriction
* @since 3.0.0
*
2018-03-18 23:42:09 +00:00
* @param {number} x - [description]
* @param {number} y - [description]
*
2018-03-18 23:42:09 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
2017-08-17 02:48:39 +00:00
setFriction: function (x, y)
{
this.friction.x = x;
this.friction.y = y;
return this;
}
};
module.exports = Friction;