用鼠标移动pixi js箭头旋转

时间:2018-07-26 07:53:38

标签: canvas rotation mouse pixi.js

我想用mouseX拖动箭头角度,但是卡住了,当前旋转方向与mouseX相反。

 const mouseX = app.renderer.plugins.interaction.mouse.global;
    app.ticker.add(() => {
        if (options.isDown) {
            this.rotation = -((mouseX.x / app.view.width) / (mouseX.y / app.view.height));
            options.arrow.rotation = this.rotation;
}

    })

game arrow image

0 个答案:

没有答案