const / enum

This commit is contained in:
Richard Davey 2018-03-29 15:50:48 +01:00
parent 37589ffe00
commit 9f36b5e8b4
4 changed files with 35 additions and 16 deletions

View file

@ -372,7 +372,7 @@ var Texture = new Class({
* @method Phaser.Textures.Texture#setFilter
* @since 3.0.0
*
* @param {(Phaser.Textures.LINEAR|Phaser.Textures.NEAREST)} filterMode - The Filter Mode.
* @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode.
*/
setFilter: function (filterMode)
{

View file

@ -164,7 +164,7 @@ var TextureSource = new Class({
* @method Phaser.Textures.TextureSource#setFilter
* @since 3.0.0
*
* @param {(Phaser.Textures.LINEAR|Phaser.Textures.NEAREST)} filterMode - The Filter Mode.
* @param {(Phaser.Textures.FilterMode.LINEAR|Phaser.Textures.FilterMode.NEAREST)} filterMode - The Filter Mode.
*/
setFilter: function (filterMode)
{

View file

@ -4,23 +4,28 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Filter Types.
*
* @name Phaser.Textures.FilterMode
* @enum {integer}
* @memberOf Phaser.Textures
* @readOnly
* @since 3.0.0
*/
var CONST = {
/**
* Linear filter type.
*
* @name Phaser.Textures.LINEAR
* @type {integer}
* @since 3.0.0
* @name Phaser.Textures.FilterMode.LINEAR
*/
LINEAR: 0,
/**
* Nearest neighbor filter type.
*
* @name Phaser.Textures.NEAREST
* @type {integer}
* @since 3.0.0
* @name Phaser.Textures.FilterMode.NEAREST
*/
NEAREST: 1

View file

@ -4,24 +4,38 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var Extend = require('../utils/object/Extend');
var FilterMode = require('./const');
/**
* @namespace Phaser.Textures
* @property {integer} LINEAR - Linear filter type.
* @property {integer} NEAREST - Nearest neighbor filter type.
*/
/**
* Linear filter type.
*
* @name Phaser.Textures.LINEAR
* @constant
*/
/**
* Nearest Neighbor filter type.
*
* @name Phaser.Textures.NEAREST
* @constant
*/
var Textures = {
Parsers: require('./parsers'),
FilterMode: FilterMode,
Frame: require('./Frame'),
Parsers: require('./parsers'),
Texture: require('./Texture'),
TextureManager: require('./TextureManager'),
TextureSource: require('./TextureSource'),
LINEAR: 0,
NEAREST: 1
TextureSource: require('./TextureSource')
};
Textures = Extend(false, Textures, FilterMode);
module.exports = Textures;