phaser/src/physics/arcade/components/Friction.js

70 lines
1.4 KiB
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* [description]
*
* @name Phaser.Physics.Arcade.Components.Friction
* @since 3.0.0
*/
var Friction = {
/**
* [description]
*
* @method Phaser.Physics.Arcade.Components.Friction#setFriction
* @since 3.0.0
*
2018-03-18 23:29:46 +00:00
* @param {number} x - [description]
* @param {number} [y=x] - [description]
*
2018-03-18 23:29:46 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFriction: function (x, y)
{
this.body.friction.set(x, y);
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionX
* @since 3.0.0
*
2018-03-18 23:29:46 +00:00
* @param {number} x - [description]
*
2018-03-18 23:29:46 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionX: function (x)
{
this.body.friction.x = x;
return this;
},
/**
* [description]
*
* @method Phaser.Physics.Arcade.Components.Friction#setFrictionY
* @since 3.0.0
*
2018-03-18 23:29:46 +00:00
* @param {number} y - [description]
*
2018-03-18 23:29:46 +00:00
* @return {Phaser.GameObjects.GameObject} This Game Object.
*/
setFrictionY: function (y)
{
this.body.friction.y = y;
return this;
}
};
module.exports = Friction;