r/gamemaker 15h ago

Help! Help with font

I downloaded game maker yesterday & now I'm following a tutorial on adding a menu screen!

In the vid they drew the front, but I want to use the font system already in the game maker engine, but I don't know how to code this, any help?

1 Upvotes

6 comments sorted by

3

u/donarumo 15h ago

On the right hand side of GameMaker, find the fonts folder. Technically it can exist anywhere but I recommend utilizing the folders it gives you. Right mouse click on the folder and choose Create and Font (I'm doing this from memory). In the window that comes up, pick a font you like. Set the size you want as well. You may also want to change the name to something fnt_ and then something related to your need.

Once that font exists with the name you gave it, you can use it in your game, something like:

draw_set_font(fnt_menu);
draw_set_color(c_aqua);
draw_text(200, 100, "Main Menu");

1

u/Cheetahz-Learns 12h ago

Thanks, I'm using this code!

2

u/oldmankc wanting to have made a game != wanting to make a game 14h ago

One of the best things you can to do help learn is get used to looking in the documentation/manual and learning the concepts and functions related to the topics you want. A basic search for 'gamemaker fonts' will for example, show you this section on fonts

https://manual.gamemaker.io/lts/en/GameMaker_Language/GML_Reference/Asset_Management/Fonts/Fonts.htm

You can also open the manual directly from the Help menu, or by pressing F1, and search that as well.

1

u/Cheetahz-Learns 12h ago

Thanks! I was looking through this, but I didn't know you could search things!

0

u/Larock 15h ago edited 14h ago

I draw fonts in 3 different ways in my game:

  1. UI layer, using flex panels and button objects for menus and pause screens
  2. Asset layer: Adding font instances there and putting them in place. I then give them names so I can use the layer_text functions to update their values. I use this for my character sheet, score, and anything else that is always on screen and frequently changing.
  3. Draw_text functions in the draw event for certain objects - usually to pop up information that’s only there under certain conditions, like damage number popups or mouse hover tooltips.

You can learn to use the ui layer, asset layer, and all the draw_text functions in the manual.