Jump to content

[iOS Safari] FPS Drops when using atlasJSONHash


guy
 Share

Recommended Posts

Hi !

 

I'm having a weird problem when trying to use animations.

I have created a sprite sheet texture using http://www.leshylabs.com/apps/sstool/.

 

I'm loading it in the preload stage:

game.load.atlasJSONHash('bat', 'media/assets/bat_sprite.png', 'media/assets/bat_sprites.json');

The problem i am encounter is a mad fps drop (from 60 to 10-9 fps) when adding a sprite from the atlas.

 

First i thought its related to the animation being played, but after some debug i found out that:

this.bat = game.add.sprite(380, 350, 'bat');

is enough to have the fps drop, even before adding and playing the animations 

 

I'm attaching the sprite png.

 

Thanks alot

guy

 

post-13523-0-27925900-1426761964.png

Link to comment
Share on other sites

I honestly don't believe the fact it's using a texture atlas is related to the fps drop. Sometimes it can be, if the atlas is massive for example and blows up Safari memory, but yours is tiny (although it could be being added to a game already overflowing with assets I guess).

 

I'd suggest creating an entirely blank project / game with JUST your bat sprite in it and see what happens. My guess is it'll work fine - which will help you narrow the issue down to something else in the game at least.

Link to comment
Share on other sites

Yeah I will try to debug it in blank project too

 

From what I'm seeing now when I save it as web-app and launch it from homescreen the perforemnce is really bad (10fps)

but running it from safari thought its around 60.

 

Any ideas? i'm going crazy :(

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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