JSFiddle - React, Tailwind, and code Playground

by Matt Karl

HTML

<script src="https://pixijs.download/dev/pixi.min.js"></script>

JavaScript

const app = new PIXI.Application({ background: '#999' });
document.body.appendChild(app.view);

Object.defineProperty(PIXI.DisplayObject.prototype, 'buttonMode', {
  get() { return this.cursor === 'pointer'; },
  set(value) { this.cursor = value ? 'pointer' : null; },
});

const text = new PIXI.Text('Click Me');
text.interactive = true;
text.buttonMode = true;

app.stage.addChild(text);