I’m finding that if I alt-tab out of the game, or set a new resolution, my canvas’ reset.
I’m currently using a canvas for an opacity mask, to hide areas of the map the player hasn’t yet visited. I don’t render all visited areas every tick, instead adding to the canvas as new areas are explored.
So how can I prevent the canvas clearing it’s data?
Or is there an event i can catch when the viewport is resized?