• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Scaling problem

P

Python

Guest
Hey guys!

In my engine, for some reason, switching to fullscreen mode is also affecting my game's scanlines. I'll explain it below, but first let me show what I have coded so far:

Code:
//DRAW GUI

//Draw scanlines
draw_set_colour(c_black);

for (var i=0;i<window_get_width();i+=2)
    draw_line(-1,i,window_get_width(),i);
My view width and height are 320x240, while my port on screen is 640x480.

As you can see, the code above does work normally. BUT my game does also have a HUD. I had to add this piece of code so the it scales correctly while on fullscreen:

Code:
//CREATE EVENT
display_set_gui_size(view_wview[0],view_hview[0]);
However, this code seems to be affecting the scanlines. If I remove it, the scanlines works the way I want on both fullscreen and windowed mode, but my HUD "shrinks". If I keep it, my HUD works but scanlines are affected.

I tried everything I could but no success. :/

Oh, and btw, sorry if my problem sounds kinda confusing.

Any help would be appreciated. :)
 
R

RealsLife

Guest
I'm still a noob but I would draw your HUD on the GUI layer(so it isn't affected by full screen) and the draw_line on the normal draw layer? Maybe I'm just saying random stuff but you could try it xD!
 
P

Python

Guest
I'm still a noob but I would draw your HUD on the GUI layer(so it isn't affected by full screen) and the draw_line on the normal draw layer? Maybe I'm just saying random stuff but you could try it xD!
I tried doing that but it didn't work. :/

have you tried using
surface_resize(application_surface, display_get_gui_width(), display_get_gui_height()); ?
You mean switch from display_set_gui_size to this? If so, yeah. No success. :(
 

RangerX

Member
What you should do, in my humble opinion if to draw your scanlines last and on top of everything on the GUI layer.
 
P

Python

Guest
What you should do, in my humble opinion if to draw your scanlines last and on top of everything on the GUI layer.
Can you tell me more details about it? Sorry, I'm very noob when it comes to resolution and scaling. :p
 

RangerX

Member
You let all your object draw their stuff in "pre, normal or post draw event" like default GameMaker. Then you can also draw your HUD last. (you could draw everything in pre or normal draw, then the HUD in post draw so its always in top).
And then over everything, on the GUI layer (see Draw GUI stuff in the manual) you draw your scanlines --> which therefore would be on top of everything and not influenced at all by the game behind since on a completely different layer/plane.
 
P

Python

Guest
You let all your object draw their stuff in "pre, normal or post draw event" like default GameMaker. Then you can also draw your HUD last. (you could draw everything in pre or normal draw, then the HUD in post draw so its always in top).
And then over everything, on the GUI layer (see Draw GUI stuff in the manual) you draw your scanlines --> which therefore would be on top of everything and not influenced at all by the game behind since on a completely different layer/plane.
Yay, it worked! :)

I realized I was drawing everything to the GUI, hence the drawing problem. How stupid I am, haha.

Thank you guys for the help! :)
 
Top