Closed smjnab closed 4 years ago
This is behaving as expected. The worldView
is recalculated in preRender
. If you need the values from it prior to that, which is extremely unlikely, you can call Camera.preRender()
yourself to double-update them.
Version
Description
The worldView of the main camera is not properly updated if you go back and forth between scenes. this.cameras.main.worldView will on first load have a proper width value, but if you leave scene and come back to scene, the value will be 0 at creation, but updated to the correct value after one update.
Example Test Code
Modify this test https://labs.phaser.io/edit.html?src=src/scenes/changing%20scene.js with the below code to see value on load and after one update. Click to go to next scene, click to come back to first scene.
Additional Information