09-09-2022, 02:47 PM
(09-09-2022, 12:57 AM)mnrvovrfc Wrote: You could use a program like Windows Paint (Windows) or GIMP (Linux) that shows you the current position of the mouse cursor in pixels. Then make rectangular selections around the picture elements to get the top and left coordinates, and the width and height of each sprite. This promises a long time of hard work, and experimentation and it's not for the lazy. The considerate people creating the sprite sheets create sprites that require the same width and height which would make programming easier, but the sprites have to be gathered correctly. You have to watch out because some larger screen elements (like a boss in an arcade game) could occupy two or more squares of an "unit" in the sprite sheet.
The cool thing about Texturepacker (besides the fact that it offers a free version to try) is that you can export a JSON (or other format) file that will tell you all those coordinates for you. Because I was thinking the exact same thing as you: If I have to manually go into Paint and get the coordinates of 100+ sprites . . . oh my . . . that is going to be a long day and lots of coffee!
Here's an example of sprite coordinates in JSON format (I'm sure it could be adjusted to use in QB64PE quite easily):
Code: (Select All)
"filename": "4.png",
"frame": {"x":400,"y":0,"w":200,"h":200},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":200,"h":200},
"sourceSize": {"w":200,"h":200}