Sample Font


fonts = new font_class("Arial", 64, 255, 255, 255,5);
fonts.add_texture(working_dir + "/resources/metal.bmp");
fonts.outline_text(0, 0, 0, 10);
fonts.add_texture(working_dir + "/resources/invmetal.bmp",0);

The above code generates an Arial bitmap font that is 64 pixels in size and white. The last number “5″ adds some spacing to the characters. This allows for a border. We add a texture to the font. We then outline the text with a black 10 pixel border. And finally we add a texture to the border. We do this by having the border be color 0 (solid black) and applying the texture only to pixels that are color 0.

If you’re feeling ambitious you could add another border and then texture it again so you have two textured borders. The border is applied outside the font so the second border will border the first border. Border border border.

This will allow for some much better looking fonts.

Leave a comment

You must be logged in to post a comment.

ss_blog_claim=70b9168863fc97c91e6d88b40542a327 ss_blog_claim=70b9168863fc97c91e6d88b40542a327