Jump to content

Texture dimensions error (spritesheet)


CaptKiwi
 Share

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);

 

Cheers!

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...

Hi,

 

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..

cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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