Fix a game that gets cut off or stretched when the phone is turned
The picture was drawn for one screen shape, but phones come in many shapes and turn around. Without care the game is cut off, stretched, or blurry. This entry shows how to make the AI scale the game to fit any screen, keep its proportions and stay sharp.
Why this works
A picture has a shape, and a screen has another. If you scale the width and height by different amounts, you stretch the picture, and if you fill the screen you cut it. One scale for both directions keeps the shape, and the leftover space becomes bars.
When not to use it
Bars are the wrong answer in a game where the world should fill every screen, such as a scrolling map or a runner. There, show more or less of the world at the edges, and keep the important things in a middle area that always fits.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 20 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Fix a game that gets cut off or stretched when the phone is turned" (read_entry game-cut-off-after-rotating-phone) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP