-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Isometric map with collision layer does not render #546
Comments
This one is on me, looks like a stupid mistake where I forgot to floor the value after i changed the function ... I'll fix that within 1 hour and will post you a patch here. Thank you for the report !! |
@mfpierre done, if you could apply the same changes on your side (or pull the last commit if you cloned the repo) and confirm it is now working back, that would be great ! @parasyte I'm still unsure of what is the right thing to do with all these function when calculating the tile position based on x/y coordinates, and where the final value should be rounded/ceiled : do we let the the function returns a float (like now), or do we floor or round or ceil it by default ? (note: when TMXLayer is drawing the given rect, the renderer floors the value for the top-left coordinates, but ceils them for the bottom-right ones) |
That's pretty weird. It should really be flooring all sub-pixel values, or you get weird artifacts during scrolling. The only time the floor-upper-left/ceil-bottom-right thing will help is when you have rectangles that are going to be less than 1px wide or high. And actually the renderer can handle sub-pixel draw destinations, and is preferable for smooth scrolling at frequencies that aren't evenly divisible by the frame rate. If that makes sense ... The easiest way to imagine is a slow scroll that shifts the map position by a fraction of a pixel per frame. Instead of a nice smooth scroll with antialiasing, it will move by one pixel at a time with several frames of pause between each. |
well the only place where i'm really ceiling the value is at the following place : but this might be unnecessary extra protection..... Then about sub-pixel yes, but i'm not sure i'm getting your point as anyway we use a double array internally to store all tiles, and we cannot use a floating value when accessing it. Also is sub-pixel not a performance killer on some browser (it used to be on Safari in a massive way) |
@obiot Thanks for the quick fix, I can confirm it's working on my side, the map is now rendered properly 👍 However I seem to have another issue with the same function when moving the player around, I will try to identify it
|
@mfpierre Thanks ! (Merci Pierre?) they are certainly some limit test missing in the getTile function, as if the given coordinates are out of the map size, it should just return null : |
@obiot De rien ;) You were right, it occurs when the player goes out of the map boundaries. |
@obiot no it's fine I'm closing the issue |
Hi,
On MelonJS 1.1.0-beta.1, isometric map with a collision layer does not render anymore. There is an error on the GetTile function.
If I remove the collision layer from the TMX file, the map is rendered normally.
The text was updated successfully, but these errors were encountered: