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

[ SORTED OUT]font in different screen size

RODO

Member
hello guys, well I have a problem and a doubt at the same time. I'm creating a menu system that works great, but I'm having to deal with font and room changes. The camera resolution is much higher in the menu room than in the phase room for example (where the game basically rolls):
1626216852460.png
as you can see, the font doesn't lose quality when it's in this selection menu room, because the camera size is quite big (1360x768) but when I change rooms and go to the phase room:
1626217204310.png
the quality goes down a lot, and I don't know how to fix it. I tried using a surface to see if I could simulate a different size and see if the font improved but it didn't seem to help.
how to get around this problem? How do you make a "beautiful" and nice menu in a different size? I appreciate any help
 

TsukaYuriko

☄️
Forum Staff
Moderator
If you want a font in a different size, create a different font resource at a different size. Font resources are pre-rendered. You can't change the size at run time without quality loss.
 

RODO

Member
If you want a font in a different size, create a different font resource at a different size. Font resources are pre-rendered. You can't change the size at run time without quality loss.
but there I had to reduce the font by the options, does that mean that for rooms with a different size camera I have to use a specific font?
 
Are you using the GUI layer? That's exactly what this is for. Anything GUI related (like menus, titles, popups, etc) should be placed on the GUI layer. That way, you can have a consistent resolution for all the menus/text, while being able to change resolution in your normal "room" drawings.
 

TheouAegis

Member
If you use the normal Draw event, or Draw Begin or Draw End, then your text will be drawn to the application_surface, which is what is getting scaled down between rooms. Therefore it doesn't matter what size font you use, it will always get scaled down between rooms. Of course, the larger the font, typically the better the scaling. If you use the GUI events, as RefresherTowel said, the resolution for that typically does not change (if it does, you can always just use gui_set_maximise() or whatever the function is to prevent rescaling), and as such the text will look the same across all rooms.
 

RODO

Member
Are you using the GUI layer? That's exactly what this is for. Anything GUI related (like menus, titles, popups, etc) should be placed on the GUI layer. That way, you can have a consistent resolution for all the menus/text, while being able to change resolution in your normal "room" drawings.
If you use the normal Draw event, or Draw Begin or Draw End, then your text will be drawn to the application_surface, which is what is getting scaled down between rooms. Therefore it doesn't matter what size font you use, it will always get scaled down between rooms. Of course, the larger the font, typically the better the scaling. If you use the GUI events, as RefresherTowel said, the resolution for that typically does not change (if it does, you can always just use gui_set_maximise() or whatever the function is to prevent rescaling), and as such the text will look the same across all rooms.
Hmmm I'm using an obj for my menu but I think I can change it to draw in GUI, and I thought Draw GUI had screen size limitation. Anyway thank you very much for the suggestions, this was a great help and I will try to use the methods that were passed
 

RODO

Member
1626289734005.png
I achieved. I changed the obj code for it to run in draw_gui, I just need to fix the position in which it is drawn. thank you very much for the help
 
View attachment 41328
I achieved. I changed the obj code for it to run in draw_gui, I just need to fix the position in which it is drawn. thank you very much for the help
If i'm not mistaken, the draw_gui needs extra care with positioning things, as it rellies on screen position, it's a gui at all. It should fix your problem, as your menu seems to use map position coords.
 

FoxyOfJungle

Kazan Games
If i'm not mistaken, the draw_gui needs extra care with positioning things, as it rellies on screen position, it's a gui at all. It should fix your problem, as your menu seems to use map position coords.
The GUI layer by default uses the game/application window size. 1:1 scale. This can be changed using display_set_gui_size().
If my size is 1280x720, then I can simply only draw things on the X axis from 0 to 1280, as well as the Y from 0 to 720.
Note: It is also possible to draw outside the GUI, however I never needed to do this.

I want to remember too that the size of the GUI is independent of the size of application_surface.
 

TheouAegis

Member
Ah, so it must be display_set_gui_maximise() that restricts the Scaling (and sets the screen coordinates of the GUI as well... yeah that's a thing).
 
Top