GSDP:GAM100/CProcessing/loadFont()

From Inside
Jump to: navigation, search

loadFont()

Description

The loadFont() function takes a True Type Font file (.ttf) and loads it into a PFont for usage drawing text. Once a font has been loaded, you can set it as the current font to use it with the function textFont().

Parameters

loadFont( const char * filepath )

  • filepath - (const char *) The path of the font to be loaded. This can be a full explicit path or a relative location.

Example

  // Create a PFont variable to store the font
  PFont myFont;

  // Load a font from the Assets folder
  myFont = loadFont("./Assets/Fonts/MyFont.ttf");

  // Set this font as the current font
  textFont(myFont);

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>