You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modify the replace directive in go.mod so that it points to latest version of tilepix on your machine
(I tried running the latest version instead of latest release since the latest release crashed, but with a different error)
go run examples/tiled_test/main.go
Crash with output:
ERRO[0000] TileLayer.Batch: layers' tileset is nil error="cannot create sprite from nil tileset"
ERRO[0000] TileLayer.Draw: could not get batch error="cannot create sprite from nil tileset"
ERRO[0000] Map.DrawAll: could not draw layer error="cannot create sprite from nil tileset"
panic: cannot create sprite from nil tileset
Expected behavior tiled_test/main.go is a copy-paste of the front page example program, but with GhostForest.tmx instead.
A guess is that something is assumed about how .tmx files are structured that I am missing (I'm a new user to Tiled aswell as tilepix).
Environment (please complete the following information):
In Tiled, make sure any empty layer (meaning no tile has been "painted" on it in Tiled) exists. For example by removing such layers.
Save the .tmx with only layers that are non-empty
Suggested fix, one of:
a) when loading a .tmx file, either do not create layers that have no tile set (all are nil) so that this crash is prevented
b) make rendering code not assume sprites exist for a layer (just skip rendering it if the sprite is null)
c) error-out if the loaded .tmx file contains empty levels, e.g something on the style of
"Error: .tmx files with layers without any tiles are not supported"
Describe the bug
tilepix crashes with message "cannot create sprite from nil tileset" on simple example program.
To Reproduce
(I tried running the latest version instead of latest release since the latest release crashed, but with a different error)
go run examples/tiled_test/main.go
Expected behavior
tiled_test/main.go
is a copy-paste of the front page example program, but withGhostForest.tmx
instead.A guess is that something is assumed about how .tmx files are structured that I am missing (I'm a new user to Tiled aswell as tilepix).
Environment (please complete the following information):
Additional context
Thanks for a neat little library! I wouldn't mind pair-programming with you to help fix this issue :)
The text was updated successfully, but these errors were encountered: