DrawText /Drawing

void DrawText(vector2 position, string text, string bitmapFontFile, uint color, float scale = 1.0f)

Draw text strings to screen. This function supports bitmap fonts exported by the AngelCode's BMFont tool (*.fnt files on text mode). Fonts may use multiple bitmap pages, but it is highly recommended to use only one page per font for better performance.

The *.fnt font files and all its pages must be in the <project-directory>/data/ folder. Ethanon Engine includes to the projects some default bitmap fonts:

  • <project-directory>/data/Verdana14.fnt
  • <project-directory>/data/Verdana14_shadow.fnt
  • <project-directory>/data/Verdana20.fnt
  • <project-directory>/data/Verdana20_shadow.fnt
  • <project-directory>/data/Verdana24.fnt
  • <project-directory>/data/Verdana24_shadow.fnt
  • <project-directory>/data/Verdana30.fnt
  • <project-directory>/data/Verdana30_shadow.fnt
  • <project-directory>/data/Verdana64.fnt

Font files listed above are included by default. The user may create and edit his own fonts with BMFont.

// text drawing example
DrawText(vector2(0,200), "Text drawing test!", "Verdana14_shadow.fnt", ARGB(250,255,255,255));