import { Point } from "pixi.js" ; import { EventEmitter } from "eventemitter3" ; export class EventPoint extends Point { public event ! : any ; _x : number = 0 ; _y : number = 0 ; constructor ( ) { super ( ) ; this . event = new EventEmitter ( ) ; } set x ( x ) { this . _x = x ; this . emit ( "chageX" ) ; } get x ( ) : number { return this . _x ; } set y ( y ) { this . _y = y ; this . emit ( "chageY" ) ; } get y ( ) : number { return this . _y ; } param name param fn param context public on ( name , fn , context ? ) { this . event . on ( name , fn , context ) ; } public emit ( event , ... args ) { this . event && this . event . emit ( event , ... args ) ; } public off ( name , fn ? , context ? ) { this . event . off ( name , fn , context ) ; } }