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

Texture ID is only set when composite parent is true. #155

Open
emilebergeron opened this issue Sep 22, 2023 · 0 comments
Open

Texture ID is only set when composite parent is true. #155

emilebergeron opened this issue Sep 22, 2023 · 0 comments

Comments

@emilebergeron
Copy link

When trying to create a Tilemap using an array of baseTextures, I noticed that the .tile() function would always render the first texture, regardless of the index I gave it. Digging into the issue, I noticed that the textureId (https://github.com/pixijs/tilemap/blob/123f8530c10bb1de790346d435ad65345ce8b2ae/src/Tilemap.ts#L491C22-L491C22) is only set when compositeParent is true, otherwise it stays at a value of 0 and always picks the first sprite.

I manage to work around the issue by using one of two methods:

  1. Pull the ID assignation out of the if statement, assigning it the texture index
  2. Manually set composite parent to true (not really sure of the implications of this)

I was wondering if this was a bug of if I was just not using the library properly. If it is indeed a bug, I can make a PR applying one of the two fixes I found.

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

No branches or pull requests

1 participant