Jump to content

Atlas instead of sprites?


Jirka1111
 Share

Recommended Posts

No because you need that to be available before the rest of your game assets are. If the preload bar is part of the same image the game sprites are in, you can't show it until they've all loaded. Which kind of defeats the purpose of a loading bar.

Link to comment
Share on other sites

Yeah, that's right  :D What if I need to change my character sprite? Do I have to use kill() function and then game.add.sprite?

 

EDIT: Cannot set frameName: bird.png?

 

What the hell? Name is the same...

 

Preloader:

 

this.load.atlas('atlas', 'images/atlas.png', 'images/atlas.json');

 

Main state:

 

Bird.bird = this.add.sprite(Bird.GAME_WIDTH/3, Bird.GAME_HEIGHT/2, 'atlas');

Bird.bird.frameName = 'bird.png';
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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