2015-03-01 07:00:17 +00:00
|
|
|
/**
|
2015-03-23 23:27:14 +00:00
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2016-04-04 21:15:01 +00:00
|
|
|
* @copyright 2016 Photon Storm Ltd.
|
2015-03-23 23:27:14 +00:00
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Smoothed component allows a Game Object to control anti-aliasing of an image based texture.
|
2015-03-01 07:00:17 +00:00
|
|
|
*
|
|
|
|
* @class
|
|
|
|
*/
|
2015-02-17 05:15:04 +00:00
|
|
|
Phaser.Component.Smoothed = function () {};
|
|
|
|
|
|
|
|
Phaser.Component.Smoothed.prototype = {
|
|
|
|
|
|
|
|
/**
|
2015-03-23 23:27:14 +00:00
|
|
|
* Enable or disable texture smoothing for this Game Object.
|
|
|
|
*
|
|
|
|
* It only takes effect if the Game Object is using an image based texture.
|
|
|
|
*
|
|
|
|
* Smoothing is enabled by default.
|
2015-02-17 05:15:04 +00:00
|
|
|
*
|
2015-03-23 23:27:14 +00:00
|
|
|
* @property {boolean} smoothed
|
2015-02-17 05:15:04 +00:00
|
|
|
*/
|
|
|
|
smoothed: {
|
|
|
|
|
|
|
|
get: function () {
|
|
|
|
|
|
|
|
return !this.texture.baseTexture.scaleMode;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function (value) {
|
|
|
|
|
|
|
|
if (value)
|
|
|
|
{
|
|
|
|
if (this.texture)
|
|
|
|
{
|
|
|
|
this.texture.baseTexture.scaleMode = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (this.texture)
|
|
|
|
{
|
|
|
|
this.texture.baseTexture.scaleMode = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|