Jump to content

How to deal with a sprite sheet wider than the WebGL limit?


lpbr
 Share

Recommended Posts

Hi, I have a sprite sheet with 9694 pixels width that I can NOT make it narrower because it has 74 frames with 131 pixels each.

However it is blowing WebGL (see snapshot with the error attached)... How could I solve this issue?

error.jpg

Link to comment
Share on other sites

Sounds like you won't be able to pack them all in one sheet. You make the sprite sheet 2048x2048 max. if you want to be able to open it on mobile devices.

You might be able to pack as many as possible with TexturePacker.

- Use "Multipack" to pack multiple sheets at once.
- Enable trimming if the sprites have transparency

You won't get a strip but tightly packed sheets. Don't worry about the sprite position - Phaser can read the data files that TexturePacker creates and knows here to find the sprites.

Link to comment
Share on other sites

Thanks, I will check this out. Now I am running into another issue that may be related to. Since I didn't know about TexturePacker I had the "ingenuous" idea (LoL!) of chop my sprite sheet into two different halves (first half of frames on one and the second half of frames on another). Basically I made two animations and used onLoop event of the first one to trigger the second, I think you got the picture. Ok, it worked on my computer but then when I tried on an actual mobile (my Samsung J2) I just got a big black screen. Not nice. Anyway when I commented the lines of code that added the animations to the stage the code worked, so I am sure that the problem is there. After you mention the TexturePacker I am almost sure that this approach (using too wide sprite sheets) may be a real problem maker. Anyway, back to the square one. Let's check the TexturePacker stuff!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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