GML Help With GUI_set_size Please

Petrik33

Member
GML:
global.VIEW_W = 960;
global.VIEW_H = 540;
global.VIEW_RES=global.VIEW_W/global.VIEW_H

var camera_W=global.VIEW_W;
var camera_H=global.VIEW_H;

var screen_w=display_get_width();
var screen_h=display_get_height();
var screen_res=screen_w/screen_h;


if(screen_res>global.VIEW_RES)//Screen is Wider
{
    camera_W = floor(global.VIEW_H*screen_res);
}

if(screen_res<global.VIEW_RES)//Screen is higher
{
    camera_H = floor(global.VIEW_W/screen_res); 
}

var _check = true;
var _rm = room_next(room);
var  _rprev = _rm;

while (_check = true)
{
    var _newcam=camera_create_view(0,0,camera_W,camera_H,0,-1,0,0,0,0);
    var _cam=room_get_camera(_rm,0);
    camera_destroy(_cam);
    room_set_camera(_rm,0,_newcam);
    room_set_viewport(_rm, 0, true, 0, 0,screen_w,screen_h);
    room_set_view_enabled(_rm, true);
      
    if (_rm = room_last)
    {
        _check = false;
    }
    else
    {
        _rprev = _rm;
        _rm = room_next(_rprev);
    }
}

view_wport[0]=screen_w;
view_hport[0]=screen_h;
window_set_fullscreen(true)
application_surface_enable(true);
surface_resize(application_surface,screen_w,screen_h);
display_set_gui_size(camera_W,camera_H);

global.GUI_W=display_get_gui_width()
global.GUI_H=display_get_gui_height();
This is my display initialization code, the game runs full screen and looks this way(LatestScreenshot14);


And if I change the parametrs of
Code:
display_set_gui_size(screen_W,screen_H)
to the camera view parametrs the gui looks PIXEL PERFECT but it appears too small actually.(Screenshopt 13)


I am running the game with basic size of 960x540 on the 1280x1024 PC.

So could you please help me with those Scailing and Resolution twicks andgui resizing, maybe I should use different resolution assets for GUI, and AM I actually doing it alright???
 

Attachments

Last edited:

Petrik33

Member
You need to run display_set_gui_maximise() or whatever.
Yeah, it works right, just like passing screen sizes as arguments to gui_set_size. So I guess the only solution is to make sprites for HD and FULLHD Resolutions, so they can fit the size well, am I right?
 
Last edited:
Top