Jump to content

Texture dimensions error (spritesheet)


Recommended Posts

Hi Guys,

Could someone elaborate on what the following error message means :


"Texture Error: frame does not fit inside the base Texture dimensions [object Object]".


It happens when trying to use a spritesheet creator (like texturepacker) which uses default dimentions. If I manually make my own sheet, making sure the width and height dimensions fit the sprites, I don't get this error.


I'm using the following loader code : 


game.load.spritesheet('target', 'http://xxxxx/games/assets/popper/bullets/bulletsheet.png' 67, 67, 5);



Link to comment
Share on other sites

Hi rich,


If you're using Texture Packer you should really be using game.load.atlas and giving it the image + json data that TP generates. When you export from TP make sure you pick "json (hash)" format.


Did you mean to use "game.load.atlasJSONHash" for "json (hash) format" and "game.load.atlas" for "json (array) format"? I also looked at the examples and confirmed their use.


Link to comment
Share on other sites

  • 1 month later...



I've just encountered this error, but my TexturePacker stuff was all right, and the loading in Phaser was correct.


Turned out to be a cache problem. Make sure you clear your browser's cache before wasting more time checking your code.



or, as I do from now on, on my development version, add a random query to the url of all your resources:

var randomurl= '?r='+(Math.floor(Math.random()*999999));game.load.image('img', 'assets/image.png'+randomurl);game.load.spritesheet('sheet', 'assets/spritesheet.png'+randomurl, 64, 64);//etc..


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...