2018-02-12 16:01:20 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2019-01-15 16:20:22 +00:00
|
|
|
* @copyright 2019 Photon Storm Ltd.
|
2018-02-12 16:01:20 +00:00
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
|
|
|
|
2018-02-08 04:01:44 +00:00
|
|
|
/**
|
|
|
|
* Adds an Image Element to a Texture.
|
|
|
|
*
|
|
|
|
* @function Phaser.Textures.Parsers.Image
|
2018-10-10 09:49:13 +00:00
|
|
|
* @memberof Phaser.Textures.Parsers
|
2018-04-16 15:37:07 +00:00
|
|
|
* @private
|
2018-02-08 04:01:44 +00:00
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to.
|
|
|
|
* @param {integer} sourceIndex - The index of the TextureSource.
|
|
|
|
*
|
|
|
|
* @return {Phaser.Textures.Texture} The Texture modified by this parser.
|
|
|
|
*/
|
2017-04-18 14:31:30 +00:00
|
|
|
var Image = function (texture, sourceIndex)
|
2016-12-06 16:18:28 +00:00
|
|
|
{
|
|
|
|
var source = texture.source[sourceIndex];
|
|
|
|
|
|
|
|
texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);
|
|
|
|
|
|
|
|
return texture;
|
|
|
|
};
|
|
|
|
|
2017-04-18 14:31:30 +00:00
|
|
|
module.exports = Image;
|