Font Awesome for Phaser - Main

Render Font Awesome icons in Phaser via font. Load the fonts with loadFont() and use IconText.

Font Awesome Icons

Render Font Awesome icons in Phaser via font. Load the fonts with loadFont() and use IconText to display beautiful, scalable icons in your Phaser games.

Features

  • 🎨 Font Awesome Icons: Access to thousands of Font Awesome icons
  • 📏 Scalable: Vector-based icons that scale perfectly at any size
  • đŸŽ¯ Easy to Use: Simple API for adding icons to your game objects
  • 🎨 Customizable: Full control over colors, sizes, and styling
  • ⚡ High Performance: Optimized for 60fps gameplay with minimal overhead

Live Example

Loading game...

Usage Example

import { IconText, loadFont, fontIcons } from 'font-awesome-for-phaser';

// Load Font Awesome fonts
await loadFont();

class MyScene extends Phaser.Scene {
  create() {
    // Create a house icon
    const houseIcon = new IconText({
      scene: this,
      x: 300,
      y: 200,
      icon: 'house',
      iconStyle: 'regular', // 'solid' | 'regular' | 'brands'
      size: 64,
      style: { color: '#ffffff' },
    });
    this.add.existing(houseIcon);

    // Create a heart icon
    const heartIcon = new IconText({
      scene: this,
      x: 200,
      y: 200,
      icon: 'heart',
      iconStyle: 'solid',
      size: 48,
      style: { color: '#ff0000' },
    });
    this.add.existing(heartIcon);

    // Create a star icon
    const starIcon = new IconText({
      scene: this,
      x: 400,
      y: 200,
      icon: 'star',
      iconStyle: 'solid',
      size: 48,
      style: { color: '#ffd700' },
    });
    this.add.existing(starIcon);
  }
}

Icon Styles

Solid Icons

Filled icons with solid appearance. Most commonly used style.

iconStyle: 'solid'

Regular Icons

Outlined icons with transparent fill. Great for subtle UI elements.

iconStyle: 'regular'

Brand Icons

Brand-specific icons for logos and social media.

iconStyle: 'brands'

Available Icons

Font Awesome for Phaser includes thousands of icons across different categories:

🏠

Home & Building

house, building, home

â¤ī¸

Health & Life

heart, plus, medical

âš™ī¸

Settings & Tools

gear, wrench, tools

🎮

Gaming & Fun

gamepad, dice, puzzle