UNPKG

vectorengine

Version:

This is a minimal WebGL vector rendering engine written for AssemblyScript.

33 lines (27 loc) 739 B
import { GameObject } from "./GameObject" import { VectorEngine } from "./VectorEngine" export abstract class ClickableGameObject extends GameObject { //implements Clickable { constructor() { super(); if (VectorEngine.SN != null) { VectorEngine.SN.addClickable(this); } } protected _mouseDown: bool; protected _mouseOver: bool; get mouseDown(): bool { return this._mouseDown; } set mouseDown(val: bool) { this._mouseDown = val; } get mouseOver(): bool { return this._mouseOver; } set mouseOver(val: bool) { this._mouseOver = val; } abstract mouseOverTest(x: f32, y: f32): bool; abstract onMouseDown(): void; abstract onMouseUp(): void; }