Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/events

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/events

UI events for scene graphs

  • 6.5.10
  • latest-6.x
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
55K
increased by1.31%
Maintainers
2
Weekly downloads
 
Created
Source

@pixi/events

This packages implements the Federated Events API, the plumbing behind the propagation of UI events into the PixiJS scene graph.

Installation

npm install @pixi/events

Usage

import { extensions, Application, InteractionManager } from 'pixi.js';
import { EventSystem } from '@pixi/events';

// If you are using the pixi.js/pixi.js-legacy bundles, you'll need to remove the interaction
// plugin. This is not needed when using the scoped (@pixi/) packages directly.
extensions.remove(InteractionManager);

const app = new Application();
const { renderer } = app;

document.body.appendChild(app.view);

// Install the EventSystem
renderer.addSystem(EventSystem, 'events');

// Add a click listener!
stage.addEventListener('click', function handleClick()
{
    console.log('Hello world!');
});

// Render stage so that it becomes the root target for UI events
renderer.render(stage);

// Dispatch a synthetic event on the canvas to test it.
renderer.view.dispatchEvent(new PointerEvent('click', {
    pointerType: 'mouse',
    clientX: 1,
    clientY: 1,
    isPrimary: true,
}));

Keywords

FAQs

Package last updated on 06 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc