Skip to content

Text and Font Customisation

brutalexcess edited this page Nov 5, 2014 · 3 revisions

You can now customise the colours, fonts and font sizes on-the-fly without hard-coding it into the engine itself. This means you can change these options, even while in the game. Using the below in-built functions, you can execute this in the Game Event code field using a callEvent(id);, or in the Passage's text field.

Known Font names:

  1. "main" - This is assigned to the Regular Open Sans font.
  2. "main-bold" - This is assigned to the Bold Open Sans font.
  3. "main-italic" - This is assigned to the Italic Open Sans font.
  4. "main-bolditalic" - This is assigned to the Bold and Italic Open Sans font.

setLinkFormat

This function allows you to set the format of links. The name of a recognised registered font (this font must be included with the engine), the size and colour.

Example setLinkFormat("main-bold", 12, 0x0000FF);

This sets the link format to Bold with the Open Sans format, with a size of 12 and a colour of blue. For a list of hexadecimal colours, check out this page.

setTextFormat

Same as above, but sets the format for the text of the passage.

setBGColor

This sets the colour of the background.

Example setBGColor(0xFFFFFF);

This sets the background to white.

setPassageColor

This sets the colour and transparency of the Passage background.

Example setPassageColor(0x000000, .4);

This sets the colour of the passage background to black with an alpha of 40%. 100% means the background will fully black.

setMenuTextColor

This sets the font colour of the Menu text.

Example setMenuTextColor(0x000000);

Clone this wiki locally