CreateJS:尝试使用CSS转换旋转画布的问题?

时间:2018-12-28 04:27:22

标签: canvas html5-canvas createjs create.js

 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旋转画布后,鼠标事件无法正确响应吗?

0 个答案:

没有答案