phaser/src/gameobjects/components/ScaleMode.js

60 lines
1.3 KiB
JavaScript
Raw Normal View History

var ScaleModes = require('../../renderer/ScaleModes');
2018-02-01 00:25:33 +00:00
/**
* Provides methods used for getting and setting the scale of a Game Object.
*
* @name Phaser.GameObjects.Components.ScaleMode
* @since 3.0.0
*/
var ScaleMode = {
_scaleMode: ScaleModes.DEFAULT,
2018-02-01 00:25:33 +00:00
/**
* The Scale Mode being used by this Game Object.
* Can be either `ScaleModes.LINEAR` or `ScaleModes.NEAREST`.
*
* @name Phaser.GameObjects.Components.ScaleMode#scaleMode
* @type {integer}
* @since 3.0.0
*/
scaleMode: {
get: function ()
{
return this._scaleMode;
},
set: function (value)
{
if (value === ScaleModes.LINEAR || value === ScaleModes.NEAREST)
{
this._scaleMode = value;
}
}
},
2018-02-01 00:25:33 +00:00
/**
* Sets the Scale Mode being used by this Game Object.
* Can be either `ScaleModes.LINEAR` or `ScaleModes.NEAREST`.
*
2018-02-01 01:36:52 +00:00
* @method Phaser.GameObjects.Components.ScaleMode#setScaleMode
2018-02-01 00:25:33 +00:00
* @since 3.0.0
*
* @param {integer} value - The Scale Mode to be used by this Game Object.
*
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
*/
setScaleMode: function (value)
{
this.scaleMode = value;
return this;
}
};
module.exports = ScaleMode;