gibbon.js
Version:
Actor/Component system for use with pixi.js.
33 lines • 935 B
JavaScript
import { Component } from "../core/component";
export class Collider2d extends Component {
get width() { return this.actor?.width ?? 0; }
get height() { return this.actor?.height ?? 0; }
/**
* Actor flags of objects to check hits against.
* Hits will only be tested when
* (otherActor.flags & this.hitFlags )!==0
*/
hitFlags = Number.MAX_SAFE_INTEGER;
/**
* True if actor does not move.
*/
isStatic = false;
_changed = false;
/**
* Returns true if size or position has changed this frame.
* Currently unused.
*/
get changed() {
return this._changed;
}
constructor() {
super();
}
init() {
const pos = this.position;
const size = this.actor.transform.size;
//this._lastPos = new Point(pos.x, pos.y);
//this._lastSize = new Point(size.x, size.y);
}
}
//# sourceMappingURL=collider2d.js.map