Sign in to follow this  
sergil

buttons

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.