-
Notifications
You must be signed in to change notification settings - Fork 18
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
Only works with map sizes that are a power of 2? #16
Comments
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 |
There is a public setter for that which is used in the demo: Line 267 in f4eb89f
|
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. |
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.
The text was updated successfully, but these errors were encountered: