rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.21k stars 261 forks source link

Virtual JoyStick out of control #208

Closed x-wk closed 2 years ago

x-wk commented 2 years ago

When there are two cameras in the scene and the main camera.zoomTo(1.5), this joystick will jump uncontrollably


      const
         camera2 = this.cameras.add(),
         uiLayer__ = this.add.layer(),
         base = this.add.circle(0, 0, 100).setStrokeStyle(3, 0x0000ff).addToDisplayList(uiLayer__),
         thumb = this.add.circle(0, 0, 60).setStrokeStyle(3, 0x00ff00).addToDisplayList(uiLayer__),
         joyStick = new VirtualJoyStick(this, {
            radius: 100,
            x: 400,
            y: this.scale.height - 400,
            base: base,
            thumb: thumb
         });

      //@ts-ignore
      this.cameras.main.ignore(uiLayer__);
      this.cameras.main.zoomTo(1.5);
rexrainbow commented 2 years ago

Thumb object jumping issue is fixed in latest minify file. See this demo Will upgrade npm package later.

rexrainbow commented 2 years ago

Camera-ignored layer is another issue.

x-wk commented 2 years ago

AWESOME