• 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!

GameMaker Font issue relating to screen resolution

inertias

Member

So above is a picture of a sprite that contains a very small font. My game is at 1920x1080 resolution and my monitor matches that as well. My problem is that when I draw this font to the screen (using the draw gui event), the font only appears clearly depending on where my mouse coords are (I am drawing the font relative to my mouse coords).

Observe:
(I am using the "keep aspect ratio" setting and the window in this instance is 1920x1080.

and when I move my mouse slightly...

as you can see, some letters will get cut off. Clearly this is screen tearing (or pixel disintegration? Dunno the accurate term). I have tried the "use synchronization to void tearing" option, but to no avail.

What's more, since this font is already so small, if I lower the resolution of my game the font becomes unreadable. I know this seems obvious, but other games seem to handle different resolutions with small font well, where things may get slightly more blurry, but not completely unreadable unless the resolution was lowered really, really, low. I suppose I need the font to not shrink with everything else when resolution is lowered?

Any help would be greatly appreciated. I know these issues appear all the time and I do know about this tutorial: https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995 but it doesn't seem to really address this issue.
 
if you don't have to move the font depending on the mouse coords, try to move it by "x+=1;" kind of code and check if you get the same issue or not. I think its about sub-pixels which I'm not informed a lot about.
but if you have to move fonts with mouse, then you may turn on different anti-alias levels via "display_reset(aa, vsync);"
just wanted to say things that came in my mind as no one answered.
 

Phil Strahl

Member
Have you tried rounding/flooring the coordinates first? E.g.
Code:
draw_text(floor(mouse_x), floor(mouse_y), "Here is the font in-game.")
 
Top