https://github.com/davidfig/pixi-intersects
shape collision / intersects library for pixi.js
https://github.com/davidfig/pixi-intersects
Last synced: 23 days ago
JSON representation
shape collision / intersects library for pixi.js
- Host: GitHub
- URL: https://github.com/davidfig/pixi-intersects
- Owner: davidfig
- License: other
- Created: 2016-07-04T23:56:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-28T14:26:00.000Z (over 8 years ago)
- Last Synced: 2025-03-28T11:51:06.646Z (about 1 month ago)
- Language: JavaScript
- Size: 731 KB
- Stars: 45
- Watchers: 1
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.hbs
- License: LICENSE
Awesome Lists containing this project
README
## intersects
shape collision / intersects library for pixi.js## rationale
this is a simple libary that i designed for use with my game engine. most of the better collision libraries were too large or too heavily invested in physics. i wanted something simple that worked well with pixi.js.## Code Example
// point-Rectangle intersection
var sprite = new PIXI.Sprite(texture);
sprite.shape = new Intersects.Rectangle(sprite);
sprite.position.set(5, 5);
if (sprite.shape.collidesPoint(new PIXI.Point(10, 10)))
{
console.log('intersected');
}## Live Example
https://davidfig.github.io/intersects/## Installation
npm i yy-intersects
# API Reference
{{>main}}* * *
Copyright (c) 2016 YOPEY YOPEY LLC - MIT License - Documented by [jsdoc-to-markdown](https://github.com/75lb/jsdoc-to-markdown)