Skip to content

Use first item of an array of tilesets when making a TilemapGPULayer #7163

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

Open
wants to merge 2 commits into
base: v4.0.0
Choose a base branch
from

Conversation

ChrisCPI
Copy link

@ChrisCPI ChrisCPI commented Jun 11, 2025

This PR

  • Fixes a bug

Describe the changes below:

In the createLayer method on a tilemap, it says that a string or tileset (or an array of those) can be passed in for tileset. However, the TilemapGPULayer (according to its documentation) can only support one tileset. And so, when the gpu parameter was true, the GPU layer didn't expect to see an array, and so when passing in an array, it breaks.

Now, when gpu is set to true, it checks if tileset is an array. If it is, then it will only pass in the first item of that array when creating the layer. If the array has more than one item, it gives a warning.

Fix #7158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants