Skip to main content

BitmapText

Props

https://pixijs.download/dev/docs/PIXI.BitmapText.html

Usage

Live Editor
Result
Loading...

Example

Make sure to load the bitmap font data before mounting.

See https://pixijs.io/examples/#/demos/text-demo.js

import { render } from 'react-dom'
import { Stage, BitmapText } from '@pixi/react'

PIXI.Loader.shared
.add('desyrel', './assets/desyrel.xml')
.load(onAssetsLoaded)

const App = () => (
<Stage>
<BitmapText text="Hello World" style={{ fontName: 'Desyrel', fontSize: 35 }}>
</Stage>
)

function onAssetsLoaded() {
render(<App />, document.getElementById('root'))
}