miguelfeliciano Posted February 12, 2014 Share Posted February 12, 2014 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 More sharing options...
jcs Posted February 12, 2014 Share Posted February 12, 2014 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 miguelfeliciano 1 Link to comment Share on other sites More sharing options...
miguelfeliciano Posted February 13, 2014 Author Share Posted February 13, 2014 Thanks JCS, I'll try the Atlas method. Most of the images will be draggable by the player, so I won't need to animate the images unless I add some new feature that requires animation. Link to comment Share on other sites More sharing options...
Recommended Posts