miguelfeliciano

Best Practice for Graphics

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

 

Share this post


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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.