When I run my game, the test window display correctly my game, but not when I run on my android phone. The game is resize and a grey rectangle appears at the bottom of the screen.
CodePudding user response:
It appears that:
- The Stretch Aspect is set to Expand on the project settings -> general -> display -> window (this setting is not visible on the picture, you need to scroll down). See Multiple resolutions.
- And you are either:
- Not using
Control
s for the UI. - Or you didn't set the layout to Full. See Size and anchors.
- Not using
- The default clear color is Gray (which is the default) on project settings -> general -> rendering -> environment. You can change the color to match your background. Or if you are mainly using solid color backgrounds, you can use that instead of a
ColorRect
or whatever you are using.
Test your game on desktop, windowed (not full-screen) and resizable (and not borderless). That way you can and resize the window to different sizes to see how it behaves. I remind you that different smartphones have different screen sizes.
Unrelated: you need allow hidpi to have the game window show up at all in some monitors.