RobLoach / raylib-aseprite

Load Aseprite files for animated sprites in raylib.
zlib License
70 stars 5 forks source link

Tilemap Info #18

Open wwderw opened 1 year ago

wwderw commented 1 year ago

With the new tilemap ability in Aseprite 1.3, any plans to support loading/displaying tilemap info to help setup collisions/animations etc for environments?

RobLoach commented 1 year ago

Thanks, would be awesome to have this, as then we might not need to use Tiled or another system :stuck_out_tongue_closed_eyes:

Made an issue in the cute_aseprite queue https://bit.ly/3ZewWaN

Regarding collisions, you can load Slice data with LoadAsepriteSlice(), which does have Bounds. Looks like the structs should be moved to the definition section so that the properties can be grabbed though. Getting the Rectangle bounds might be important :wink:

wwderw commented 1 year ago

Thanks for doing that. I should have thought of that given the cute_header is the dependency. Sorry about that.

RobLoach commented 1 year ago

No need to be sorry. It has been something Iv'e been wanting too. Glad to have the issue open and know people have been thinking of it too.

RobLoach commented 1 year ago

Hav eyou used much of the Tilemap stuff in Aseprite? I haven't explored it much. How does it work?

wwderw commented 1 year ago

There was a little bit of a wonky start for me with the actual creation of the individual maps and then getting them laid out after that. At first, it looked like it was creating and laying them out in a map at the same time, which lead to some funky results. Maybe I was just slow on the uptake, I dunno.

I'm hoping that with one program having both functionality and a nice mechanism to read/load/display from that one format will do better compared to using something like Tiled. As an individual program, I do like Tiled, but either with Raylib or with Phaser (at least last time I checked with Phaser) I haven't found an easy mechanism to handle Tiled files. I just export as a PNG and manually apply collisions etc, which can be tedious, but it did work.