Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Waclaw-I opened this issue Apr 25, 2022 · 1 comment

Comments

@Waclaw-I
Copy link
Contributor

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.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants