Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_google_webfontloader

Plugin, ACE table, Discussion thread
Dependence: None

Introduction
Loads web font then gets web font loaded events.
Reference: webfontloader

Usage
  1. Call actions under "Add" category to add web font
  2. Call "Action:Loading" to start loading web fonts
  3. "Condition:On active" will be triggered while all web fonts loaded completed.
This plugin only loads web font ONCE.

Google web font
Sample capx
Call "Action:Google" to add google web font.

Custom web font
Sample capx - CSS file , sample capx - font file
Call "Action:Custom" to load custom web font. Parameter "URL" could be
  • web URL of CSS file
  • web URL of font file
Load all files at local
Sample capx - CSS file , sample capx - font file
Follow these step if designer want to run the app without network. ( API of this web font loader is loading in "Action:Loading" usually )
  1. Set property "API source" to "Local".
  2. Add file "webfont.js" into project. "webfont.js" could find in the folder of this plugin
  3. Call "Action:Custom" and "Action:Loading" described in previous section.

Events
Sample capx
When "Action:Loading" is invoked, these events will be triggered.
Loading start
  • "Condition:On loading": triggered while loading fonts starting
  • "Condition:On font loading": triggered while loading a font starting, get loading font family name by "Expression:LastFamilyName".
Loaded results
  • "Condition:On font active": triggered while a font family loaded completed, get loaded font family name by "Expression:LastFamilyName".
  • "Condition:On font inactive": triggered while a font family loaded failed, get loaded font family name by "Expression:LastFamilyName". Timeout is set in property "Timeout".
  • "Condition:On inactive": triggered while all fonts loaded failed.
  • "Condition:On active": triggered while all fonts loaded, success or timeout.

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About