Quiz 19
Today
- I won't be in class BUT can we talk about the proportionality function
for the mouse? :^)
Sure. The main idea is that we move proportional to the signed distance that the mouse is from the center of the window.
That signed distance is
mx - cx
wheremx
is the mouse x coordinate, andcx
is the x coordinate of the center of the window. - Would love to visually see how the camera moves in space when a click happens.
- What is the significance of event bubbling/ is it a good or bad thing?
In general, it's a great thing. It means that you can reliably get an event that you want to handle, even if the thing that the user clicks on isn't exactly the thing you attach the handler to.
However, it's less of an issue for us, because we typically just attach our event handlers to the canvas or to the document. However, it can arise if, for example, we have two canvases that we want to attach event handlers to.