You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "Expand" scale mode in Phaser is generally excellent, but it has a significant issue.
When I configure my game with a width of 1080 and a height of 1920 (a portrait mode game), and use the "Expand" scale mode, the canvas size can become excessively large when the screen is in landscape orientation with a wide aspect ratio. For instance, the canvas might expand to 5000x1920 or even larger, depending on the aspect ratio.
I encountered this problem when my game started crashing on all Android devices in landscape mode with a Framebuffer status: Incomplete Attachment error.
The solution seems to be the ability to configure maximum canvas width and height limits (something like maxCanvasWidth and maxCanvasHeight options).
While max.width and max.height config options already exist, they appear to only limit the size of the HTML element, not the actual canvas width and height. I haven't been able to find a suitable way to use these options to prevent the excessive canvas size issue.
The text was updated successfully, but these errors were encountered:
Hi @leha-games, could you provide code examples so we can have a closer look?
Also did you set the parent property in the game config?
Without setting the parent property, you will need to manually call the setParentSize method in the Scale Manager to set the maximum width and height for the canvas.
An example of the parent property in the scale object in the game config should look something like this:
The "Expand" scale mode in Phaser is generally excellent, but it has a significant issue.
When I configure my game with a width of 1080 and a height of 1920 (a portrait mode game), and use the "Expand" scale mode, the canvas size can become excessively large when the screen is in landscape orientation with a wide aspect ratio. For instance, the canvas might expand to 5000x1920 or even larger, depending on the aspect ratio.
I encountered this problem when my game started crashing on all Android devices in landscape mode with a
Framebuffer status: Incomplete Attachment error
.The solution seems to be the ability to configure maximum canvas width and height limits (something like
maxCanvasWidth
andmaxCanvasHeight
options).While
max.width
andmax.height
config options already exist, they appear to only limit the size of the HTML element, not the actual canvas width and height. I haven't been able to find a suitable way to use these options to prevent the excessive canvas size issue.The text was updated successfully, but these errors were encountered: