Skip to content
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

Tilemap or clip children option not drawing correctly #91665

Open
MattGoode92 opened this issue May 7, 2024 · 2 comments
Open

Tilemap or clip children option not drawing correctly #91665

MattGoode92 opened this issue May 7, 2024 · 2 comments

Comments

@MattGoode92
Copy link

MattGoode92 commented May 7, 2024

Tested versions

v4.2.1.stable
v4.2.2.stable

System information

Godot v4.2.1.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1660 Ti (NVIDIA; 31.0.15.5222) - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 Threads)

Issue description

I'm getting some really odd display issues in my editor and at runtime. The first time I noticed this was when trying to turn on "Clip only" on a Polygon2D object to clip another Polygon2D. It appeared correctly in the editor's display, but when I ran the scene, the Polygon2Ds did not appear at all. I removed objects until only the Polygon2Ds and one of my four tilemap nodes remained. Once I removed that tilemap, the objects displayed as expected.

In the MRP, only the tilemap and polygons exist in a single scene. I removed most of the tilemap's properties, but kept the .png file that the tilemap is drawing from. The .png file was created in Aseprite. There is a Polygon2D node PolygonParent which is a staircase-shape. There are two children of that Polygon2D: PolygonRed and PolygonGreen which should both be getting clipped by the boundaries of the parent. I found that by adjusting some properties of the Tilemap, such as disabling the background layer, I could no longer reproduce the issue.

I'm experiencing two issues in the MRP:

  • When "Clip children" is enabled on PolygonParent, zooming in and out of the editor's 2D map will "teleport" PolygonParent to a position of roughly (150, 0). This is a visual glitch only - the position property does not actually change.
  • When running the scene, PolygonParent again appears at the top of the screen. Adjusting the z-index property of PolygonRed or PolygonGreen can make them appear in the correct spot, though they are not clipped (I believe that last part is intended).

Steps to reproduce

  1. Zoom in and out of the 2D editor. Note when zooming out past 75% or so, the Polygons teleport to a wrong location roughly around position (0, 150) and are slightly cut off.
  2. Run the scene in the MRP and note that the Polygons appear at the same wrong location.
  3. With somewhat mixed results, I was able to get the Polygons to appear correctly by changing the position of the Tilemap. If the Y position of the Tilemap is set to -60 or below, it seems to "teleport" the Polygons to the correct spot.

Minimal reproduction project (MRP)

MRP.zip

@AThousandShips
Copy link
Member

Can you try in 4.2.2?

@MattGoode92
Copy link
Author

Thanks I forgot about 4.2.2.

I tried the MRP on it just now and the same issues were still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants