Ninjadoodle Posted July 29, 2017 Share Posted July 29, 2017 Hi @enpu In the latest Dev version of Panda 2, images loaded from atlases when using @2x @4x variants load at the wrong size, compared to when loading a single image. I also posted on Github Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 29, 2017 Author Share Posted August 29, 2017 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! Quote Link to comment Share on other sites More sharing options...
enpu Posted August 29, 2017 Share Posted August 29, 2017 Can you send me those spritesheets, so i can take a look. Thanks! email: [email protected] skype: eemelikelokorpi Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 29, 2017 Author Share Posted August 29, 2017 Hi @enpu I've just send the files through Thank you for looking into this! Quote Link to comment Share on other sites More sharing options...
enpu Posted August 31, 2017 Share Posted August 31, 2017 Hi, 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. Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted August 31, 2017 Author Share Posted August 31, 2017 Hi @enpu Thank you for your indepth explanation of the issue. It sound like it's quite annoying to deal with. I really appreciate you putting in the time to find a workaround for this, until there is a better solution. Thanks again Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 7, 2017 Author Share Posted September 7, 2017 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. Quote Link to comment Share on other sites More sharing options...
enpu Posted September 9, 2017 Share Posted September 9, 2017 Hmm i tried to create animation from the atlas that you sent and i can't see any issues with hires mode. Can you show your code where you setup your animation? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 9, 2017 Author Share Posted September 9, 2017 Hi @enpu I've just attacked an example of the sprite sheet issue. I've included a single image with @2x and @4x assets as well as the atlases. As you see, the single image loads at the correct size, while the sprite sheet anim shows at half dimensions. Thank you! Archive.zip Quote Link to comment Share on other sites More sharing options...
enpu Posted September 9, 2017 Share Posted September 9, 2017 Hmm, so the other box on the left should be same size as the one in the center? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 9, 2017 Author Share Posted September 9, 2017 Hi @enpu yup, both the @4x image and the images in the sprite sheet are 576x576. the single image displays correctly ( the big one - in the middle ) Quote Link to comment Share on other sites More sharing options...
enpu Posted September 9, 2017 Share Posted September 9, 2017 You are scaling the box on the left, that's why it's smaller: this.sprite.scale.set(.5); Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 9, 2017 Author Share Posted September 9, 2017 Hi @enpu Really sorry about this, I don't know how I missed that!! I must have looked at it 20 times!! Again sorry for the false bug report Quote Link to comment Share on other sites More sharing options...
enpu Posted September 9, 2017 Share Posted September 9, 2017 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. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted September 9, 2017 Author Share Posted September 9, 2017 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.