0.2.0 • Published 6 years ago

@katis/react-pixi v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

React Pixi renderer

Use React to render Pixi.js 2D graphics.

Example

import * as React from 'react'
import { Application } from 'pixi.js'
import { render, px } from '@katis/react-pixi'

class Player extends React.Component {
    render() {
        return (
            <container position={this.props.position}>
                <sprite image="assets/player.png" />
                <text position={{x: 0, y: -20}}>Player</text>
            </container>
        )
    }
}

const application = new Application({ ... })

render(application, <Player/>, document.getElementById('container'))