-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TexturePacker default origin of frames #288
Comments
something wrong with my picture indeed, sorry for the issue |
Hi! I'm glad you solved the issue. 0.5 is the default origin in images and sprites, for that reason the editor doesn't generate code for it. |
Thank you so much for your excellent work! I think its better to post the finding here in case someone meets the same problem. The reason is the tool texturepacker gui set the origin as 0,0 by default for every frame inside the json file. PhaserEditor2d does a very good job to respect this value and render it correctly in the first place. And the problem is, if I set it back to 0.5,0.5 in the editor, No code will be generated to correct this value, so in the phaser side, it would still be 0,0 as the texture packer indicates. The easy way to fix is just toggle off the option of texture packer to let phaser decide the origin. |
Oh! I see. Yes, because in that case, 0.5 is not the default value in Phaser, but it is in the editor. It could be a bit complicated to handle these cases. Maybe I should provide the option of forcing the editor always to generate the origin for certain objects. I'm re-opening the issue. Thanks for the kind words! |
Version
all-in-one editor
Description
Changing a image object's origin inside the prefab doesn't generate corresponding code, it looks being ignored.
But it can display correctly in the editor.
This only happens when set the origin to 0.5, if it is set to other values , code will be generated correctly
Possible solution
manually add the code
code generated like this:The text was updated successfully, but these errors were encountered: