Download

Prevent canvas from clearing on window resize?

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?

GameUISceneClient.NotifyViewportResized gets called the tick after bUpdateSceneViewportSizes gets set to true.

Unfortunately that is not exposed through unrealscript, only cpp. I have found other work arounds to this issue now anyway. Cheers