The setting position is invalid if you click the cocos button again.

problem description

cocos button click again to set the location is invalid (this.startBtn.x = 3000). The example is the

on the official website.

related codes

  startGame: function () {
        console.log("")
        this.enabled = true
        this.player.startMove(cc.v2(0, this.groundY))
        // this.startBtn.active = false
        this.startBtn.x = 3000  // 
        console.log(this.startBtn)
  },

  gameOver: function () {
    this.player.stopMove();
    this.startBtn.x = 0 // 
    // this.startBtn.active = true
 }
Jul.13,2021

did you add widget

Menu