Merge pull request #3821 from andygroff/master

Adding console warning to notify users of invalid frame config
This commit is contained in:
Richard Davey 2018-07-08 23:16:28 +01:00 committed by GitHub
commit 93d177e560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,6 +58,11 @@ var SpriteSheet = function (texture, sourceIndex, x, y, width, height, config)
var column = Math.floor((height - margin + spacing) / (frameHeight + spacing));
var total = row * column;
if (total === 0)
{
console.warn('SpriteSheet frame dimensions will result in zero frames.');
}
if (startFrame > total || startFrame < -total)
{
startFrame = 0;