Jump to content

Change Frame Width of SpriteSheet


frankdev
 Share

Recommended Posts

Hello All,

 

Sorry if this is a duplicate post; I thought this would be a fairly popular topic but I have yet to find my answer. I was wondering if it is possible to easily change the frame width of a spritesheet. When I preload the spritesheet:

this.game.load.spritesheet(ResKeys.playerSprite, 'assets/playersprites.png', 30, 30);

I pass in 30 as the width. For one of my animations, however, I want the width to be 60.

 

Thanks!

Link to comment
Share on other sites

Do you mean one frame is a different width to the others? If so, no, this isn't how sprite sheets work - they need uniformly sized frames. If you need non-uniformly sized frames you need instead to use a texture atlas using something like TexturePacker or search Google for one of the many free online texture atlas tools.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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