Login | Register

Create font

September 16, 2006, 22:22 by Calle
[loading]
-->
Today I just want to share a function with you. I found it by a coincidence. I didn't know it existed, and it must be new. It definitely didn't exist when I started using Game Maker v. 4... New for 6.x definitely. It creates a font out of a image, truly amazing:

<b>font_add_sprite(spr,first,prop,sep)</b> 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.

Comments

Loading comments... [loading]
.
Users logged in:

game maker articles, game maker examples, game maker tutorials, gmtutorials, game maker questions and answers, game maker crash course, how to create games