Custom Fonts Scripts

by DevonX

Posted on January 09, 2007 at 10:12 PM

This does exactly as it say, as most of my examples do. You can draw text using a font where you have made all of the letters as subimages in a single sprite. I know that making fonts is time consuming, but it is worth it when you can use them in your games. All you have to do is put the chars in the right order, but that isnt very hard. The main challenge in making this was getting it so it supported multiple lines of text, seperated by the infamous '#.' Not much to it, just use draw_text_custom(x,y,string,spr);

thepharaoh commented January 09, 2007 at 11:19 PM
It's okay. :)
NeutralReiddHotel commented January 10, 2007 at 1:09 AM
I just noticed how awesome Gm5 is for making this thing easier to do(using sprites).

Anyways, nothing special, but hey, could help someone else. 8/10
Candra Software commented January 10, 2007 at 1:28 AM
I used MattSoftWare's Font Example.
nicetas_c commented January 10, 2007 at 11:47 AM
It's useful for making games.
also very simple. :D
DesertFox commented January 10, 2007 at 2:24 PM
font_add_sprite(spr,first,prop,sep) Adds a new font and returns its index. The font is created from a sprite. The sprite should contain a subimage for each character. first indicate the index of the first character in the sprite. For example, use ord('0') if your sprite only contains the digits. prop indicates whether the font is proportional. In a proportional font, for each character the width of the bounding box is used as the character width. Finally, sep indicates the amount of white space that must separate the characters horizontally. A typical value would lie between 2 and 8 depending on the font size.
Gamemaker Help File

While the effort is appreciated a method already exists. Always check the help file - it saves time.

Okay. So, ten out of ten for style, but minus several million for good thinking, huh?
Zaphod Beeblebrox
Xemrel commented January 11, 2007 at 4:40 PM
Sadly, I've made that same mistake. ^_^;; It would help if GM supported it via resources, as well, rather than just a a scripted command. Otherwise, it looks like it wouldn't support it, so you don't even think to check. :/
DevonX commented January 13, 2007 at 2:51 PM
whats simpler, this or the scripts? answer that and we will see if this was neccesary.
ManuelGM commented January 15, 2007 at 6:04 PM
font_add_from_sprite() may be simplier to use, but unregistered users can't use it. So I think that it IS useful... (I made my own custom font script before, though)
Coffee commented January 24, 2008 at 2:53 AM
Very nice. ^_^

Although I wish is was more commented, although I understand it perfectly, newbs might not. 8/10