blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
23 lines (22 loc) • 672 B
TypeScript
import CollisionObject from "../collisionObject";
import PivotConstraint from "./pivot";
/**
* Constrains an {@link CollisionObject}'s position to the mouse's world position in the current {@link Camera}'s view.
*/
export default class MouseConstraint extends PivotConstraint {
/**
* Creates an {@link MouseConstraint}.
*
* @param obj The object to constrain
*/
constructor(obj: CollisionObject);
/**
* Removes the mouse constraint's listeners from the canvas.
*/
remove(): void;
private mouseListener;
/**
* Gets the mouse's world position in the current camera's view.
*/
private getMousePosition;
}