New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pixi-hammer

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixi-hammer

Use Hammerjs with pixi

  • 0.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pixi-hammer

Connect Hammer.js with PixiJS.

Allow us to use Hammer.js gesture recognizer with PixiJS instance.

Install

npm install pixi-hammer

Usage

var PIXI = require('pixi.js');
var Connector = require('pixi-hammer');

var app = new PIXI.Application(320, 400);
// initialize the Connector
var c = new Connector(app);

// assume we have a PIXI instance
var rect = new PIXI.Graphics();
rect.beginFill(0x000000);
rect.drawRect(100, 100, 100, 100);
app.stage.addChild(rect);

// listen hammer.js event from that instance
c.listen(rect, 'pinch', function(e) {
  console.log('pinching on the rect!');
});

How it works

Instead of traverse whole PIXI scene graph, this connector cache listeners to its own stack and only check the instance itself and up to the root.

TODO

  • examples for stopPropagation etc

License

MIT

Keywords

FAQs

Package last updated on 06 Mar 2018

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