-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for Tilesets and Tilemap layers. #11
Conversation
These features are new in Aseprite 1.3, and with this in place, then `.aseprite` becomes a viable format for making 2D game maps that get loaded in the browser after being parsed by this library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate your PR! Just a few questions/concerns.
Aseprite.js
Outdated
bitmaskForXFlip, | ||
bitmaskForYFlip, | ||
bitmaskFor90CWRotation }; | ||
return { ...chunkInfo, tilemapMetadata, rawCelData }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the comment in readImageCelChunk
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b11bcb1.
Aseprite.js
Outdated
@@ -349,6 +402,7 @@ class Aseprite { | |||
}) } | |||
}), | |||
palette: this.palette, | |||
tileset: this.tileset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be tilesets: this.tilesets,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b11bcb1.
Aseprite.js
Outdated
this.layers.push({ flags, | ||
type, | ||
layerChildLevel, | ||
blendMode, | ||
opacity, | ||
name}); | ||
name, | ||
tilesetIndex}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of adding a property that could be undefined
.
We could create an object at the top of this function and then add each property in it instead of creating variables and resolve it that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b11bcb1.
FYI I've also finished testing the work of using these changes to load tileset/tilemap data into a WebGL renderer. The aseprite data is loading properly with no issues - I'm just working through other issues downstream in the renderer before I commit my work up for others to see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, I'll merge this in and resolve any conflicts with any new changes. Sorry for taking so long to get back to this.
Looks like you'll have to resolve the conflicts in your branch. Should be fairly easy if you merge the Once that's done, I'll merge it and start a new release for NPM. Thanks again for your work. |
I think I've resolved the conflicts correctly, but please give it another check to be sure. |
I'll re-review it tonight and then merge it in. Thanks again for the work and sorry for the delay 😅 |
These features are new in Aseprite 1.3, and with this
in place, then
.aseprite
becomes a viable format formaking 2D game maps that get loaded in the browser
after being parsed by this library.