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
36.78k stars 7.08k forks source link

phaser3 nineslice Inconsistent display on different mobile devices #6858

Closed cy920820 closed 2 weeks ago

cy920820 commented 3 weeks ago

Version

Description

Using Nineslice to render a rounded background image, it was found that each terminal has differences in the rounded display

Example Test Code

let leftBubbleBg = scene.add
        .nineslice(
          marginX,
          y + screenHeight,
          ResourceManager.getUIKey('optionBgL'),
          null,
          textWidth,
          height,
          50,
          50,
          50,
          50
        )
        .setOrigin(0, 0)

Additional Information

greptile-apps[bot] commented 3 weeks ago

For internal use only

To address the inconsistent display of the Nine Slice Game Object on different mobile devices, please check the following:

  1. Ensure that the texture provided follows the layout structure specified in the changelog (/changelog/3.60/NineSliceGameObject.md).

  2. Verify that the dimensions for leftWidth, rightWidth, topHeight, and bottomHeight are correctly set and consistent across devices.

  3. Confirm that the minimum width and height constraints (leftWidth + rightWidth and topHeight + bottomHeight) are respected.

  4. Since this feature is WebGL only, ensure that the WebGL context is properly initialized on all devices.

Refer to the detailed documentation in the changelog for further guidance.

References

/changelog/3.60/NineSliceGameObject.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)
zekeatchan commented 3 weeks ago

Hi @cy920820.

It would be good if you could always include a link to a live example for us to check OR a complete test code like what you see in the labs (https://labs.phaser.io/) whenever you post an issue.

You can use our existing nine-slice examples here for reference.

This would help us tremendously so we will not need to recreate your test code or go through our existing examples to figure out the problem you are facing.