Texture Packer for skinning UI buttons

Hi Folks! I would like to use Texture Packer’s atlas for skinning my UI buttons. From what I’ve tried, Play Canvas does a good job generating the sprites from the atlas, but it seems that when you update the source atlas png ( generated by Texture Packer ) into Play Canvas editor, Play Canvas’s texture atlas does not update, the original atlas persists. This means all the UI sprites generated against the original atlas need to be re-generated from the new atlas and applied to each button. This seems to be a major drawback unless I’m missing something obvious? Does anyone else use this approach for skinning buttons or is there a better method I’ve not considered?


Solved- I was missing something obvious… So you still need to create a new texture atlas in Play Canvas using the new png / json output from Texture Packer. To update the individual sprite(s), you select the sprite in the library then, in the properties panel, you can assign the texture atlas property of the sprite to the new atlas. The UV mapping just works. I guess in my mind, I was expecting the atlas to update automatically when updating the png / json but this method is fine.

Does anyone know how to change PlayCanvas atlas size? Seems to default to 512 - would be helpful for it to match the size of the png? Currently I’m using Texture Packer’s multipack option to output multiple atlases…

Odd. It should match the image file size. Sounds stupid but I double check the PNG dimensions to see if they are the size you think it is.

Hi Yauster - seems if you overwrite the existing png in the library, the original png’s dimensions persist. Seems to size correctly with a new filename png. Thanks for the sanity check!

Oh, that’s equally annoying :confused: I assume the PNG is a power of 2 in dimensions?

That’s correct! I’m writing up a little list of today’s learnings to save my sanity

Yes, sorry about that bug. It’s a known issue. :slightly_frowning_face:

cc @vaios