#Viewport and aspect ratio

1 messages · Page 1 of 1 (latest)

hexed bay
#

Does anyone understand about viewports and stuff?
This is how my screen look right now, running on the browser, because I set my stretch aspect to keep, so I don't get distortion in the pixel art, but I can't think of a way to have it occupy more of the screen while maintaining my "drawing area" inside the game the same, which means: drawing exactly these elements. (9 tree stumps in the vertical and 15 in the horizontal).
Does anyone has any idea what I could do?

young falcon
#

It is physically impossible to have both.

You either keep the pixel ratio and same amount of items displayed, then stretch to fill the screen.

Or keep the pixel ratio and let the screen display more elements to fill it out.

Different screens will have different amount of height and width of pixels. So they will inevitably need to fill the empty space in some way.

#

Altho there is a LOT of empty space here, so you should at least set it to scale up. The pixels should retain their ratio.

fading kelp
#

maybe what you want is aspect-cover

#

so that you keep the pixel ratio you want and cut off the edges of the content you render

#

(but that means the edges of your game area are off the edge of the screen)

hexed bay
#

Thank you for the responses!

I didn't fully understand the replies, but I'll re read them later and do more research, and I really appreciate your help. Thank you so much!

I think I would probably rephrase what I want to be: how to scale up what I'm displaying to cover more of the monitor/screen while maintaining the aspect ratio, so if I increase the height, I also increase the width in a proportion to keep the aspect, but without showing more elements in my game screen, showing only those 9x15 tree stumps.

fading kelp
hexed bay
#

Thanks! I just found out running in the editor it works, it expands correctly when using stretch aspect to expand, but on the browser it still doesn't do that, I have no idea why. 😦

hexed bay
#

I explained it a little better here, @fading kelp @young falcon