Creates a __BASE entry for the atlas.

Defaults to __BASE if no texture frame was found in the atlas (may consider replacing with blank texture)
This commit is contained in:
Richard Davey 2016-12-07 10:58:35 +00:00
parent 5e0bbd7028
commit 07f3756761
4 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,4 @@
var CHECKSUM = {
build: 'cf1b58d0-bc6a-11e6-80ab-e1859222c781'
build: 'e17829d0-bc6b-11e6-a3c1-a55832c87262'
};
module.exports = CHECKSUM;

View file

@ -84,6 +84,8 @@ Texture.prototype = {
if (!frame)
{
console.warn('No Texture.frame found with name ' + name);
return this.frames['__BASE'];
}
else
{

View file

@ -22,6 +22,10 @@ var JSONArrayTextureParser = function (texture, sourceIndex, json)
return;
}
// Add in a __BASE entry (for the entire atlas)
var source = texture.source[sourceIndex];
texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);
// By this stage frames is a fully parsed array
var frames = json['frames'];
var newFrame;

View file

@ -22,6 +22,10 @@ var JSONHashTextureParser = function (texture, sourceIndex, json)
return;
}
// Add in a __BASE entry (for the entire atlas)
var source = texture.source[sourceIndex];
texture.add('__BASE', sourceIndex, 0, 0, source.width, source.height);
// By this stage frames is a fully parsed Object
var frames = json['frames'];
var newFrame;