#6784·phaser

Incorrect typing for Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback

Author: IKhonakhbeevaCreated Apr 8, 2024Updated Sep 21, 2026
Labels🐛 TypeScript Bug

Version

  • Phaser Version: 3.80.1
  • Operating system:
  • Browser:

Description

There is a typescript error when I am trying to create RandomZone for ParticlesEmitter.

Example Test Code

const emitRect = new Phaser.Geom.Rectangle()
new Phaser.GameObjects.Particles.Zones.RandomZone(emitRect)

Error:

Argument of type 'Rectangle' is not assignable to parameter of type 'RandomZoneSource'. Types of property 'getRandomPoint' are incompatible. Type '(point?: O | undefined) => O' is not assignable to type 'RandomZoneSourceCallback'. Types of parameters 'point' and 'point' are incompatible. Type 'Vector2Like' is missing the following properties from type 'Point': type, setTo

Additional Information