Problem with view initiation object

L

Linkdeous

Guest
Hello guys, i have a problem with my current obj_camera (as i called it when i coded it)

It work perfectly at least when both your monitor are the same size, but i've switched from my main screen (in 4:3) to a 16:9 screen, and now, the window is set to the size of the second monitor, which is 4:3..upload_2018-5-17_8-19-42.png
is there a way to take with display_get_width() a certain monitor size ? it take the second monitor size and it make the game look bad on that screen

Create Event :
Code:
height=252;
dheight=display_get_height()
dwidth=display_get_width()
ratio=dwidth/dheight
width=height*ratio
window_set_size(width*2, height*2);
window_set_min_height(dheight);
window_set_min_width(dwidth);
alarm[1]=1

if !view_enabled
   {
   view_visible[0] = true;
   view_enabled = true;
   }
view_hview[0]=height
view_wview[0]=height*ratio
Alarm[1]
:
Code:
window_center()
finally step event :
Code:
view_xview[0]=obj_player.x-width/2
view_yview[0]=obj_player.y-height/2-obj_player.sprite_height/2
 
L

Linkdeous

Guest
huh, i don't it seem ...
this very object w<orked when i had just 4:3 monitor, so i though it would work with any screen, i gonna change the port size and tell you if it work now :)
after adding this line :
view_hview[0] = view_hport[0]=dheight; view_wview[0] = view_wport[0]=dwidth;
the game still is not showing properly, am i doing something wrong ?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You want to set the view port to the same size as the game WINDOW. So:

Code:
view_wport[0] = width*2;
view_hport[0] = height*2;
// Set the window size here
Also, make sure that "keep aspect ratio" is not checked in the game options. You need it to "scale to fit".
 
L

Linkdeous

Guest
Thanks a lot, i think it fixed the problem, thanks you guys very much :)
 
L

Linkdeous

Guest
I still have one last problem ... does anyone know why does the room size matter to the view ... ? if i make a perfect 16;9 room, the view is set perfectly like i wanted, but if i set for exemple 2000:1050, suddenly everything get distorded ... how does one make the view be totally independant from the room size ?
 
Top