Closed rb1147x closed 2 months ago
seems to only be an issue in WEBGL and not CANVAS, also seems to be an issue with having multiple scenes render, I consolidated your example test code into a single scene (with some minor adjustments) https://jsitor.com/z3lB4A5yWE and can't get it to reproduce afterwards. I'm not versed enough in the webgl renderer to dive much further but hopefully this helps Richard or someone else track this down.
Thanks for taking a look. My original example was born from the project I'm working on that uses two scenes - one for the game world and one for drawing UI objects and handling UI interactions (e.g. dragging game items to your inventory). Although the issue presented itself while using setDepth()
and there's at least a temporary fix by setting the UI scene's camera roundPixels
property to false, maybe the root issue is more in line with what you've discovered - using webGL and multiple scenes.
I reproduced this with 1 Graphics, 1 Image, and moveUp()
: https://phaser.io/sandbox/q89fEzzs
Thanks for that example @samme - this was a roundPixels issue and is fixed in v3.85 - you can confirm this in the sandbox by changing the version to 'dev'.
Version
Description
Game objects appear to visually shift slightly when interacted with, which appears to be based on
setDepth()
. Although, this may not actually be the culprit. Here's an example:Which you can interact with here: https://jsitor.com/3vkO_hzB0S
I had made a forum post about this: https://phaser.discourse.group/t/pixel-distortion-shifting-issue/13774 so the full context is available there, but after commenting out
setDepth()
, which is being used to bring the object to the front so that it can be dragged over other game objects, the problem goes away.On the forum post, there was a solution posted to specifically set
roundPixels
tofalse
on the camera, which does solve this problem. However, this seems like a bug? Why would setting a game object's depth cause this visual issue? Also, this problem does not happen in 3.60.0.Thanks.
Example Test Code
https://jsitor.com/3vkO_hzB0S
Additional Information