0.2.1 • Published 7 years ago

pull-pixi-sprite-event v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

pull-pixi-sprite-event

A pull-stream "Through" that will throttle the source until a pixi.js event happens

install

yarn add pull-pixi-sprite-event

usage

const pull = require('pull-stream')
const listen = require('pull-pixi-sprite-event')
const {Application, Text} = require('pixi.js')

const sprite = new Text('click me')
pull(
    pull.count(),
    listen(sprite, 'pointerdown'),
    pull.log()
);

const {view, stage} = new Application()
stage.addChild(sprite)
document.body.appendChild(view)