📜  Phaser 3 添加按钮 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:57.807000             🧑  作者: Mango

代码示例1
// works with either text or an image/sprite
// const button = this.add.text( 100, 100, 'Click me!', { fill: '0f0' })
const button = this.add.sprite( 100, 100, 'button')
    .setInteractive()
    .on('pointerdown', () => button.setScale( 1.1 ))
    .on('pointerup', () => button.setScale( 1 ));