Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Icons

The tool allows to inline sprites into PIXI text objects.

Setup

import * as textIcons from 'text-icons';

textIcons.extend(PIXI);

Usage

const textObject = new PIXI.Text('PIXI @coin@ Phaser\nText Icons @coin@ !');

textObject.icons = {
  '@coin@': new PIXI.Sprite(PIXI.Texture.from('coin.png')),
}

Notes

The keys for icons object cannot contain some special symbols, which require escapes in regex.

Do not use $, . and others.

Use letters, @ and _.

About

The tool allows to inline sprites (icons) into text. Can be used with PIXI as well as Phaser

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages