Skip to content
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

Merged
merged 3 commits into from
Dec 16, 2022

Conversation

jemc
Copy link
Contributor

@jemc jemc commented Aug 4, 2022

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.

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.
Copy link
Owner

@TheCyberRonin TheCyberRonin left a 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 Show resolved Hide resolved
Aseprite.js Outdated
bitmaskForXFlip,
bitmaskForYFlip,
bitmaskFor90CWRotation };
return { ...chunkInfo, tilemapMetadata, rawCelData };
Copy link
Owner

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.

Copy link
Contributor Author

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,
Copy link
Owner

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,

Copy link
Contributor Author

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});
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b11bcb1.

@jemc
Copy link
Contributor Author

jemc commented Aug 6, 2022

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.

@jemc jemc mentioned this pull request Aug 15, 2022
Copy link
Owner

@TheCyberRonin TheCyberRonin left a 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.

@TheCyberRonin
Copy link
Owner

Looks like you'll have to resolve the conflicts in your branch. Should be fairly easy if you merge the ase-parser master branch into this one.

Once that's done, I'll merge it and start a new release for NPM. Thanks again for your work.

@jemc
Copy link
Contributor Author

jemc commented Dec 11, 2022

I think I've resolved the conflicts correctly, but please give it another check to be sure.

@TheCyberRonin
Copy link
Owner

I'll re-review it tonight and then merge it in. Thanks again for the work and sorry for the delay 😅

@TheCyberRonin TheCyberRonin merged commit 4dff429 into TheCyberRonin:master Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants