Skip to content

Commit cca6dd6

Browse files
author
Andrew Groff
committed
Adding console warning to notify users when their frame config does not create any frames
1 parent 8b13631 commit cca6dd6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/textures/parsers/SpriteSheet.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ var SpriteSheet = function (texture, sourceIndex, x, y, width, height, config)
5858
var column = Math.floor((height - margin + spacing) / (frameHeight + spacing));
5959
var total = row * column;
6060

61+
if(total === 0)
62+
{
63+
console.warn('TextureManager.SpriteSheet: Frame config produces zero frames. Check frameWidth and frameHeight.');
64+
}
65+
6166
if (startFrame > total || startFrame < -total)
6267
{
6368
startFrame = 0;

0 commit comments

Comments
 (0)