layer.on(eventName, handler)
Start listening to an event on this layer.
When an event is called the first argument is the event information. Depending on the specific event this can contain mouse positions, mouse deltas etc. The second argument is always the layer that the event occurred to.
译:开始监听在这一层的事件。
当一个事件被称为第一个参数是事件的信息。根据特定的情况下,本可以包含鼠标的位置,鼠标三角洲等。第二个参数始终是事件发生的层。
layerA = new Layer
layerA.name = "layerA"
layerA.on Events.Click, (event, layer) ->
print "Clicked", layer.name
# Output: "Clicked", "layerA"