What is inCamera in Phaser 3?

I know in Phaser 2 you could use sprite.inCamera to detect if a sprite was in the camera or not, but it apparently doesn’t work in Phaser 3 anymore. Is there anything similar in Phaser 3 that might work?


I use:

if (this.scene.cameras.main.worldView.contains(sprite.x,sprite.y)) {
  // your code here ...

Thanks, that works!

Also camera.cull().

1 Like