Jump to content

Latest Panda 2 Dev - Images from atlases size bug - SOLVED


Recommended Posts

  • 5 weeks later...

Hi @enpu

I just wanted to double check if this is a bug, or whether I'm doing something wrong.

I am using texture packer and the Panda *.json format to export my sprite sheet - has something changed and do need to to use another format? 

The sizes of the graphics are all wrong when using @2x and @4x variants.

I'd like to start sharing some source code / examples with the community in the near future, but right now I can't get this working :)

Thanks in advance!

Link to comment
Share on other sites


This was a bit tricky one, because there are two types of json files supported in Panda. Generic json files and sprite sheets. When using hires mode, you only want sprite sheet json filenames to change to load the hires one, not on generic json files. Since you can't know which type of json file it is before loading it, this makes it a bit tricky. I think there are two options:

1) Load json file and read it. If it's sprite sheet and hires is on, then load new proper hires version of the json file. Bad thing in this option is, that then there is always one unnecessary json file loaded in every sprite sheet. Though json files are typically pretty small files.

2) Change sprite sheet json files to other extension. Like spritesheet.atlas or something. This would need update on Texture Packer also.

I did now some changes on the loader based on the option 1, since it doesn't require any changes from user. But i will really have to think about other options, because loading unnecessary files doesn't feel really good idea. 

Link to comment
Share on other sites

Hi @enpu

There is still a problem with sizing when setting up animations from atlases.

The animations show at half the size they are supposed to be. I've tested this by loading a single image with @2x @4x variants and also by loading a single image from an atlas.

Everything works unless you are setting up an animation.

Link to comment
Share on other sites

No problem!

I'm doing some refactoring on the code and there will be some functions renamed/moved etc and anchors are switched back to percents (using pixels was not a good idea after all). So if you are in a middle of a project, might be good idea to not pull any changes if you don't have any bigger issues, or you might have to rewrite some of your code.

Link to comment
Share on other sites

Hi @enpu

i actually prefer the percentages for anchors :)

I don't mind rewriting the code, but it would be awesome to have some sort of resource / log, of the changes made.

I'd really like to do some tutorials as well, and keep them up to date with the latest changes, but a lot of the time I don't know what's changed until I hit an error.

A good example is the particles. I can't get them working, as I can't figure out what's changed since the last version.

A small log file with the changes made would be absolutely awesome :)

Thanks again!

Link to comment
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.

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.


  • Recently Browsing   0 members

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