#Viewports stretching themselves to fit application surface?

7 messages · Page 1 of 1 (latest)

bold talon
#

The behavior of it filling the window by default has been the default for as long as I can remember, it would prob be a rare case like yours to not want it to fill the screen.

But if you want an effect like your first screenshot, you can manually draw the surface like this in some kind of handler object.

//in create
application_surface_draw_enable(false);
///and in the post draw event
draw_surface(application_surface, 0,0)
#

yeah, just drawing it like that will not scale it up at all, so if the app surface is smaller than the window, it will leave black space

you can use draw_surface_ext if you wanna scale it up or down too,

or work out some math to center the surface in the black void
I usually do something like (window size-surface size)/2

and you can also draw additional sprites or whatever you want in the black void too

#

it depends on how you set up your app surface, if you used surface_resize anywhere or anything

but
surface_resize(application_surface,320,180)
and this system should make it so it's not scaled up to fill the 640 x 360 space

#

depends on what you wanna draw, draw end works like any other draw event so you can directly draw sprites and such before or after

or do something like, make only the gameboy screen the application surface, and do like

draw_sprite(GB_Background,0,0)
draw_surface(application_surface,wherever,wherever)
#

you will also have to use
display_set_gui_size
display_set_gui_maximise
to scale and position the GUI layer however you want btw

#

display_set_gui_size to set the base size,
display_set_gui_maximise to set how much it's scaled up, and the offset from the upper left

bold talon
#

putting aside messing with viewports and all that, what effect do you want to have in the end?
like, do you have a mock up of what you want the end result to be?
maybe there is a better way to do it.

most people probably want the view to fill the game window, so the behavior of it stretching to fit by default makes sense
I have not really messed with multiple viewports at once though.