ggez resize window without distording drawn elements

266 Views Asked by At

I use ggez and would like to resize the window. The only way I found is

graphics::set_drawable_size(&mut ctx, width, height);

However, when I use it, the white circle I drawn turns into a white ellipse, and a seemingly grey circle appears below. So is there another way of resizing window, one that doesn't distort what is drawn ?

1

There are 1 best solutions below

0
On BEST ANSWER

use

graphics::set_screen_coordinates(ctx,rect)

right after declaring changing size with graphics::set_mode(ctx,windowmode) turns the ellipse back into a circle. The gray shape vanishes after reducing the window (this is a pretty obscure thing).