def initialize(bamph, bar:, bang:, &block)
# ...
end
var canvas = $('#canvas')[0]
var stage = new createjs.Stage(canvas)
var but = new createjs.Shape(
new createjs.Graphics().beginFill("#999999").drawCircle(30,30,30)
)
but.mouseEnabled = true
but.on('mousedown', function() {
console.log('click')
})
stage.addChild(but)
createjs.Ticker.on('tick', function() {
stage.update()
})
* {
margin: 0;
padding: 0;
}
canvas {
transform: translate(100px, 100px) rotate(30deg);
}
使用css旋转画布后,鼠标事件无法正确响应吗?