RetiPie
Guides

Screen Size and Fit

Make your HTML5 game fill every phone's game area, see the two sizes RetiPie checks at upload, what Fit to screen does, and engine settings to use.

On RetiPie your game runs in the app's game area: the part of the phone screen under the status bar and above the app's tab bar. Its size depends on the phone, so build a layout that fills whatever area it gets.

The game area

OrientationWidthHeight
Portraitabout 360–450 CSS pxabout 560–860 CSS px
Landscapeabout 560–860 CSS pxabout 360–450 CSS px

A landscape game gets the same area turned sideways. RetiPie detects the orientation when you upload.

Your game should:

  • Fill the area. Size the page and the canvas to the viewport (100% of html and body), not to a fixed desktop size.
  • Don't scroll the page. Keep everything inside the area: content below the fold is cut off, and players can't reach it.
  • Handle resize. The area can change size while your game runs. Lay out again on every resize event.
  • Survive a 0 × 0 size. The game can start before its area is visible. Skip the layout while the width or height is 0 and wait for the next resize, instead of dividing by zero.

A plain HTML5 setup that does all of this:

<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
  html, body { margin: 0; height: 100%; overflow: hidden; }
  canvas { display: block; width: 100%; height: 100%; }
</style>
function layout() {
  const width = window.innerWidth;
  const height = window.innerHeight;
  if (width === 0 || height === 0) return; // not visible yet
  resizeGame(width, height); // your own layout code
}

window.addEventListener('resize', layout);
layout();

What RetiPie checks at upload

After your build is processed, RetiPie opens it in a phone-sized browser at two reference sizes (CSS px, portrait; turned sideways for a landscape game):

ReferenceSizePhone
Small375 × 578iPhone SE
Standard393 × 698iPhone 16

It looks for content that doesn't fit: a page that scrolls, or a visible element or canvas that reaches past the edge, even when overflow: hidden hides it. The result shows on the game page in Slice, and during upload:

ResultWhat you see
Fits both sizesNothing.
Cut on the small size onlyThe Fit to screen switch, turned on for you.
Cut on the standard size tooA warning. Fix the layout and upload a new version. Moderators see the warning too.
Couldn't be measuredA note. This happens when the game times out, crashes, or needs WebGL that wasn't available. Try it yourself in the Slice preview at a few sizes.

Fit to screen

When your game is cut only on small phones, RetiPie turns on Fit to screen. During the check it also measures how much room your game needs. On a phone whose game area is smaller than that, the game is laid out at the size it needs and scaled down to fill the area: the whole game shows, slightly smaller, with no black bars. On phones with enough room the game runs at their own size. It's never scaled up.

You can turn the switch off on the game page in Slice. The change applies right away and doesn't need a review. With it off, the bottom of your game may be cut on short phones such as the iPhone SE. To see the difference, open Try the game in the Slice preview, pick iPhone SE under Device, and try the game with the switch on and off.

Fit to screen is a safety net. A layout that fills any area looks better on every phone, so fix the layout when you can.

Engine settings

EngineSetting
Godot 4Project Settings → Display → Window → Stretch: Mode canvas_items, Aspect expand. Web export: Canvas Resize Policy Adaptive.
Phaser 3scale: { mode: Phaser.Scale.FIT, autoCenter: Phaser.Scale.CENTER_BOTH }, or mode: Phaser.Scale.EXPAND.
UnityCanvas Scaler → UI Scale Mode: Scale With Screen Size, Screen Match Mode: Match Width or Height or Expand, and a Web template whose canvas fills the page.
Construct 3Project Properties → Display → Fullscreen mode: Scale outer.
Cocos Creator 3.8Project → Project Settings → Project Data: Design Resolution with Fit Width and/or Fit Height.
  • Godot 4. canvas_items with expand is the default for projects created in Godot 4.7 or later; set it by hand in older projects. Adaptive is the default Canvas Resize Policy. See Multiple resolutions and the Web export options.
  • Phaser 3. FIT keeps your aspect ratio and can leave empty space; EXPAND (Phaser 3.80 or later) grows the visible area to fill it. See the Scale Manager.
  • Unity. Set Match toward the side your layout depends on. The Default, Minimal and PWA templates fill the window only in mobile browsers; a custom template or CSS that sizes the canvas to 100% of the page works everywhere. See Canvas Scaler, Web templates and Web canvas size.
  • Construct 3. Scale outer shows more of the layout instead of black bars, so keep important content near the middle. See Projects and Supporting multiple screen sizes.
  • Cocos Creator. With both boxes checked the whole design stays visible and borders may appear; with one, align your UI to the screen edges with the Widget component. See Project Settings and Auto fit for multi-resolution.

Feed preview

RetiPie doesn't take a poster from your game's screen. Add a poster, or a video with its poster, in the Game profile step before your first submission. See Feed preview for formats and limits.

On this page