Skip to content

camera.dirty flag is always true inside Phaser.Tilemaps.TilemapLayer.cullCallback #6088

@Waclaw-I

Description

@Waclaw-I

Version

  • Phaser Version: v3.55.2
  • Operating system: Windows 10 / WSL2
  • Browser: Not browser specific, tested on: Chrome, Firefox

Description

Hello! I am playing with adding my custom cullCallback for TilemapLayers, like here:
cullCallback
I want to make use of camera.dirty flag but it is always true, even if nothing is happening on the screen, no camera movement etc
I figured out this is due to the camera's scrollX and scrollY fields being overwritten every frame in preRender method here (and setting camera.dirty to true in setters).

Example Test Code

Custom CullTiles callback
Uncomment console.log inside customCullTiles method to see camera.dirty state.

Additional Information

Adding simple checks if values aren't the same seems to do the work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions