-
Notifications
You must be signed in to change notification settings - Fork 555
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
Random tile of tilemap not rendering with canvas/WebGL when rotated #1200
Comments
I should add that this is version 0.9.0, but after checking it appears 0.8.0 has the same issue. |
Hmm, definitely seems like a bug. If it occurs in WebGL and Canvas layers, but not DOM, and only for rotated entities, I bet it's an error determining whether the entity falls within the viewport. I could imagine it being some sort of rounding error due to the rotation by Do you have a fiddle/etc that reproduces the behavior? What environment (browser+OS) are you seeing it on? |
It's possible that this will be fixed by the changes in #1202 -- changing the origin of an already-rotated entity was not updating some calculated properties correctly. In particular, the position of the entity in the broad phase map was not updating correctly, and that's used for selecting which entities to render. (For Canvas and WebGL, but not DOM layers.) |
I've reproduced the issue in the You can grab the most recent develop build of Crafty here. A workaround when using 0.9 would be to specify the origin before setting the rotation property. Thanks for the report! |
I have the following code for my scene:
The tile component:
However, I am getting an issue where one of the rotated tiles is not rendered: https://i.gyazo.com/9a526fd6febb991011f32043ca73fdce.png
Only happens on canvas and WebGL, DOM works fine. Adding 1 pixel to the x position of the tile makes the issue disappear, but that obviously isn't a viable fix for a game.
The text was updated successfully, but these errors were encountered: