From 9f36b5e8b404ae71e4172ddae10dd672e8e6ecb0 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 29 Mar 2018 15:50:48 +0100 Subject: [PATCH] const / enum --- src/textures/Texture.js | 2 +- src/textures/TextureSource.js | 2 +- src/textures/const.js | 17 +++++++++++------ src/textures/index.js | 30 ++++++++++++++++++++++-------- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/textures/Texture.js b/src/textures/Texture.js index 5b480bd75..d763b611f 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -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) { diff --git a/src/textures/TextureSource.js b/src/textures/TextureSource.js index 551895d0d..f71aae339 100644 --- a/src/textures/TextureSource.js +++ b/src/textures/TextureSource.js @@ -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) { diff --git a/src/textures/const.js b/src/textures/const.js index 3066a4730..e4c33f0ca 100644 --- a/src/textures/const.js +++ b/src/textures/const.js @@ -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 diff --git a/src/textures/index.js b/src/textures/index.js index 5df9e3f3a..75fff37af 100644 --- a/src/textures/index.js +++ b/src/textures/index.js @@ -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;