Window doesn't clear if I use Query<&Window> in my draw function #14801
-
I'm having a problem where the window isn't clearing properly before each frame. I've set a clear color, and I draw a grid of sprites. When I resize the window, though, the sprite grid smears like in the image below: Here is my code:
I've figured out that the problem is the Here is a link to the full code (error is on branch window-bug): https://github.com/jcarvajal288/puzzle-dungeon/tree/window-bug |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Entities are persistent. You spawn new sprites in the |
Beta Was this translation helpful? Give feedback.
Entities are persistent. You spawn new sprites in the
draw
system, which is in theUpdate
schedule, being called every frame. So you create more and more tiles every frame. Moving thedraw
function into theStartup
schedule and having another system updating their position should be the way to go.