2D Animation & Interactivity for the Modern Web
void registerMouse() { var mouseEventListener = (MouseEvent me) { var deltax = me.localX - 203; var deltay = me.localY - 111; num angle_rad = math.atan2(deltay,deltax); particleEmitter.updateConfig(newAngle((angle_rad*180.0/math.PI)+180, me.localX)); }; glassPlate.onMouseDown.listen(mouseEventListener); glassPlate.onMouseMove.listen(mouseEventListener); }