hacktober-race icon indicating copy to clipboard operation
hacktober-race copied to clipboard

Error when window resize

Open vikthortt opened this issue 4 years ago • 3 comments

When resizing browser window the app doesn't display correctly.

error resize - hacktober race

vikthortt avatar Oct 06 '19 06:10 vikthortt

Mhmm that is a little strange, mine doesn't resize like that, it looks like:

image

LukeGarrigan avatar Oct 06 '19 20:10 LukeGarrigan

I was investigating this issue a little and it appears that when the window resize, canvas is not resizing with it. That is the canvas width and height remain the same as when first setted. Fortunatly p5 has the resizeCanvas method.

I could make the PR with just that change but when window shrinks after some threshold the game just doesnt look good anymore.

See image below console - to small

vikthortt avatar Oct 06 '19 21:10 vikthortt

Tried to fix all this in #35 The terminal now resize automaticly with the window and so do the text inside of it. Also made the player circle resize with the window, the lines still a problem since they are drawn only when receiving data from the server from what i saw, so is not possible for now to make them draw again, it would be necessary save the players position when received from the server and use this saved data to redraw the lines at every window resize.

MrSimsure avatar Oct 17 '19 15:10 MrSimsure