Jump to content

Best Practice for Graphics


miguelfeliciano
 Share

Recommended Posts

I'm still new to Phaser and have a concern of best practice for loading up images with my main concern being performance.

 

I understand how to load up images and sprites (for characters and such), but I'm building a game much like Scrabble and I created a spritesheet containing all of the images I would need.  I was able to load up the board for the game, but now I want to load up the rest of the images in that spritesheet.  The only option I can think of is to cut up the spritesheet in PS and have individual images to load up separately; I don't think a tilemap would work in my situation.

 

I was hoping to have one spritesheet (png) to load and just tell Phaser where all of the images are in that spritesheet.  I would think this would be something of a best practice instead of loading each image individually.  I'm also experimenting with the Tiled app and generating the tilemap data and then loading whatever individual images I need to load; each image would need to be draggable.

 

  • What other options are available to me?
  • Is there a plug-in that can extend the functionality of the game.load.image function?
  • What's the best practice in this kind of game scenario?

 

Thanks in advance

 

Link to comment
Share on other sites

if you export your spritesheet with an atlas (using something like texturepacker or shoebox), then phaser can load that atlas and all your sprites can share the one image file.

 

if your images were entirely the same size then you could just provide the frame indices to AnimationManager (when you are creating your animation sequences for the sprites), but this is less likely. still might be worth considering if *most* of your images were the same size, or two sizes, you could still reduce the number of image files you had to load.

 

but ideally you should export a spritesheet with atlas and use as few texture files as possible. the GPU will thank you

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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