/pixijs-mouse-event-transmitter

Transmit mouse events from pixi.js stage to other canvas.

Primary LanguageTypeScriptMIT LicenseMIT

pixijs-mouse-event-transmitter

Transmit mouse events from pixi.js stage to other canvas.

MIT License CI Test Coverage Maintainability

ReadMe Card

Demo

Demo Page

API

API document

Getting Started

Install

pixijs-mouse-event-transmitter depend on pixi.js

npm install pixi.js --save-dev

and

npm install @masatomakino/pixijs-mouse-event-transmitter --save-dev

Import

pixijs-mouse-event-transmitter is composed of ES modules and TypeScript d.ts files.

At first, import classes.

import { MouseEventTransmitter } from "@masatomakino/pixijs-mouse-event-transmitter";

const transmitter = new MouseEventTransmitter({
  transmitTarget: canvas, // transmitter target ( dom element )
  app: app, // app instance of pixi.js
});

canvas.addEventListener("pointermove", (e) => {
  console.log(e);
});