0
所以這裏的設置。對於某些上下文,我在Vue.js中運行它。移相器按鈕繪製但點擊事件不觸發
preload() {
this.load.image("button", button)
},
create() {
this.game.stage.backgroundColor = "#ffa500";
var button = this.game.add.button(this.game.world.centerX, this.game.world.centerY, 'button', test, this, 0);
button.anchor.set(0.5)
var test = function() {
console.log('hi')
}
},
update() {
}
當我點擊圖片時沒有任何反應。不知道該從哪裏繼續。
仍然不工作,你的代碼基本上運行
。我甚至嘗試用匿名函數替換測試,但仍然沒有輸出:\ –
你能告訴我更新的代碼嗎? – Yiou
感謝您跟進,但我已切換到pixi.js.我已經得到了點擊工作大聲笑。無論如何,我會給你一個滿意的答覆。 –