AntoniaChimp

Sprite sheet without JSON file

Recommended Posts

Hello !

I read about using Sprite Sheets in Pixi and about creating needed JSON files with Texture Packer.

But I already got the Sprite Atlas/Sheet. Is there an easy way or a tool to create the corresponding JSON file anyways ?

Share this post


Link to post
Share on other sites

If there's no rotation involved making a spritesheet parser for any tool is very easy even for people who hate math. It comes usually with a xml or json that lists frames with position, dimension, and names. You extract those names in a loop, create rectangles out of position/dimension, put everything in a dic and voila, now you can run another loop to create texture from the main texture and pass along those frames(rectangles) you created when parsing. NO MATH involved.

Share this post


Link to post
Share on other sites

NO MATH involved.

My nightmare.

Let me tell you about D8 Group! https://en.wikipedia.org/wiki/Dihedral_group It has 16 elements, all rotations of octagon. 12-th rotation will be FlipX, thus you can specify "texture.rotate=12" and all sprites that have that texture will be flipped horizontally! See? Its easy!

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.