FontID

From Bennu Wiki
Jump to navigation Jump to search


Definition

FontID

A FontID is an identifier associated with a certain font. It is returned by functions that load fonts, for example load_fnt(). You can use the FontID in functions to specify the font used in the writing of texts like write(), write_int(), write_float(), write_string(), write_var() and write_in_map().

Notes

Font "0" is the built-in font, and can be used in functions as well.

Example

import "mod_text"
import "mod_key"

Global
    My_font;
End

Process Main()
Begin

    //Using the built-in font:
    My_font=0;
    Write(My_font,320/2,200/2,4,"Game programming is awesome!");

    Repeat
        frame;
    Until(key(_ESC))
End

Used in example: write(), key()

This will result in something like:
FontID.png