Skip to content

Instantly share code, notes, and snippets.

@amirrajan
Last active November 10, 2024 14:28
Show Gist options
  • Save amirrajan/8ad3fdd852399301fc258eeaccae226f to your computer and use it in GitHub Desktop.
Save amirrajan/8ad3fdd852399301fc258eeaccae226f to your computer and use it in GitHub Desktop.
xplat UI considerations for games

Things to consider when building a cross-platform game:

  1. Minimum button sizes for touch displays and small screen (eg steamdeck, mobile, nintendo switch hand held mode) is about 60 pixels. Anything smaller will fail lotcheck (Apple, Android, Nintendo).
  2. Visual feedback of UI interactions (Android, Apple -> they'll reject a feature/showcase of your game if you don't have this).
  3. Safe area/layout considerations. Avoid things like notches and app switch "chin". If you're making a game that can render edge to edge/without letter boxing, test at an aspect ratio of 21:12 (1680x960). Your safe are should be centered with an aspect ratio of 16:9 (placement of UI controls should always be in the safe area or they may be inaccesible because of notches and beveled edges).
  4. Button input detection with keyboard, touch, and gamepad. Navigation using keyboard, gamepad, mouse.
  5. Anything below 22px font size is pretty much unreadable on small screens (mobile, Steam Deck, Switch Lite).
  6. Text fields is a world of pain on console and is delegated to the OS (think javascript alert box).
  7. Scrollable/overflow UIs are extremely inaccessible to the blind and those with disabilities related to motor function.
  8. Option to reassign/re-pair gamepad must be provided in-game or it'll fail Nintendo lotcheck (reassignment options can be shown on start up or within a system menu -> best to do both).
  9. Terms used within instructions of gamepad controls are very strict. Using the wrong term will fail lotcheck (eg saying "Use Directional to move player." does not use the correct terms). Using images avoids this problem.
  10. Game should pause if a controller is disconnected.
  11. Option to exit the app is not allowed on iOS and Console.
  12. Option to exit the app using the Back soft key is a soft requirement on Google Play (feature request will not be allowed w/o this functionality).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment