sbiermanlytle / iioEngine

iio Engine: A JavaScript game engine for HTML5 Canvas
http://iioengine.com
455 stars 81 forks source link

Bouncing Ball Demo - Point #18

Closed blanco217 closed 10 years ago

blanco217 commented 10 years ago

Hello, In firefox v24 i noticed all the balls were create in the top left corner and in chrome v30.0.1599.69 it was working fine. After a bit of debugging window.addEventListener('mouseup', function(event) { console.log(event); var point = new iio.Vec(event.x, event.y); console.log(point);

In firefox event.x should be event.clientX and event.y should be event.clientY

sbiermanlytle commented 10 years ago

Thanks for debugging, you can also use io.getEventPosition to normalize browser inconsistencies

I've updated the demo code:https://github.com/sbiermanlytle/iioengine/commit/d5b95ace0c4a4ffb578962039cbdc54555147c9d