faiface / pixel

A hand-crafted 2D game library in Go
MIT License
4.46k stars 245 forks source link

LetterBox scaling #278

Open edwinsyarief opened 3 years ago

edwinsyarief commented 3 years ago

Hi,

Is there any example when we want to resize windows, the game interface will resized and keep the aspect ratio?

for example: Before resize image

after resize image

Thank you. Best regards, Edwin

cebarks commented 3 years ago

@edwinsyarief I think the best way to achieve this would be rendering to a canvas, and then when rendering that to the window scaled properly.