Jump to content

buttons


sergil
 Share

Recommended Posts

In the buttons examples, I see that Phaser use a spritesheet and the specify the over,out and down frames, but the way I think Phaser uses the spritesheet for this examples is dividing it in 3 frames, and the the first frame is the over, the second is the out and the third is the down.

 

If I use a texture atlas with all the sprites of the game (which will be of different sizes), how can I know which frame will be the over,out and down ? Playing with shoebox, I realize that sometimes it constructs the atlas with the sprites in different order, and the normal way to call the frames will be by sprite name?

 

What do you think?

Link to comment
Share on other sites

When you use a texture atlas, for example with Shoebox, each frame is stored in the atlas with it's filename as an ID. In phaser you can pass that ID instead of frame number. You can find a good example in the Basic project template (look into phaser/ressources/basic), especially MainMenu.js

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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