Only works with map sizes that are a power of 2?
This took me hours and hours to figure out, but it seems to be the case that this project only works with map sizes that are a power of two. That is, if your tiled map is 40x40, it just won't render anything. The map would have to be either 32x32 or 64x64.
I took a look through the demos available and sure enough, all of their map sizes are indeed a power of 2 (such as 256x256 or 512x512).
I assume this is a bug because the original algorithm from which this library was based did not have this restriction. Do you have any idea what may be causing this? None of my map sizes are of a power of two unfortunately, so they all currently render blank.
If this is not a bug but is indeed just a restriction of the library, I believe it should be noted somewhere, as this took me 6 hours to figure out.
Sounds like a bug, I haven't looked at this lib in over a year. PRs welcome.
Ah, do you have any idea what or where it might be? I'm not the best programmer and some of this code is very overwhelming to me. If you could perhaps narrow it down then maybe I'd have more luck? Because as it stands I'm not sure if I could solve this..
Oh, progress! It looks like changing private _repeatTiles = true; to private _repeatTiles = false; fixes the problem!
There is a public setter for that which is used in the demo: https://github.com/englercj/gl-tiled/blob/f4eb89f48eec9df2aa732c869d1bc94b78e99c6c/test/demo.js#L267
Make sure to use the setter, and don't just change the private because it needs to setup the texture correctly if we're not repeating tiles.