phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37.12k stars 7.1k forks source link

iOS add sprite appear snowflake screen #6865

Closed cy920820 closed 3 months ago

cy920820 commented 3 months ago

Version

Description

Create a background image using add.sprite, occasionally featuring a black snowflake screen

Example Test Code

const sprite = this.add.sprite(100, 100, spriteKey);

Additional Information

greptile-apps[bot] commented 3 months ago

For internal use only

To address the issue of a black snowflake screen when adding a sprite on iOS, ensure that WebGL context loss handling is correctly implemented. Refer to the WebGL context restore feature introduced in version 3.80.0. Specifically, check the following:

  1. Ensure that the WebGLRenderer emits LOSE_WEBGL and RESTORE_WEBGL events.
  2. Verify that the WebGLPipeline and RenderTarget classes have the necessary changes to support context restoration.
  3. Review the WebGLContextRestore.md file for detailed implementation steps.

Example:

this.renderer.on('contextrestored', () => {
  // Recreate your textures or other WebGL resources here
});

For more details, see the WebGLContextRestore.md.

References

/changelog/3.80/CHANGELOG-v3.80.md /changelog/3.80/WebGLContextRestore.md /changelog/3.15/CHANGELOG-v3.15.md

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/phaserjs/phaser/master) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
photonstorm commented 3 months ago

What is it supposed to look like? When does it happen? What actually happens?

Upload the actual assets and sample code that shows what happens.

You need to give a lot more details in your issues, they are next to impossible to help with.

This isn't a forum or Discord. If you need real-time feedback on code, those would be much better places to ask. GitHub is for bugs in Phaser you have identified and can demonstrate with a clear test case.