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

Tilemap.fill doesn't work with blank layers #761

Closed
DrHackenstein opened this issue Apr 24, 2014 · 1 comment
Closed

Tilemap.fill doesn't work with blank layers #761

DrHackenstein opened this issue Apr 24, 2014 · 1 comment

Comments

@DrHackenstein
Copy link

If a blankLayer was created, fill produces a Uncaught TypeError: Cannot set property 'index' of null. Looks like fill can't handle that blankLayers are filled with 'null' values. That's kinda strange and probably not how it's supposed to be. Filling a blank layer has to be the most useful application for fill 😃

The error was also mentioned in these threads:
http://www.html5gamedevs.com/topic/5256-replacing-tile-in-tilemap-cant-read-index-of-null/
http://www.html5gamedevs.com/topic/3942-cant-fill-my-tilemap/

As far as I can tell putTile is fixed and can be used on blank layers.

photonstorm added a commit that referenced this issue Apr 28, 2014
… objects with an index of -1 which can be replaced and updated like any other tile.

Tilemap.fill would throw an error if called on a blank tilemap full of null values (thanks @DrHackenstein, fix #761)
@photonstorm
Copy link
Collaborator

This is fixed in the dev branch. There's no such thing as a null tile now.

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

2 participants