Expert blueprint for mobile platforms (Android/iOS) covering touch controls, virtual joysticks, responsive UI, safe areas (notches), battery optimization, and app store guidelines. Use when targeting mobile releases or implementing touch input. Keywords mobile, Android, iOS, touch, InputEventScreenTouch, virtual joystick, safe area, battery, app store, orientation.
11k tokens
context cost
the whole folder, loaded on every use
17
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
451
stars on the repo
on the repository, not the skill itself
Install
one command, takes just this skill from the repository
Touch-first input, safe area handling, and battery optimization define mobile development.
NEVER Do (Expert Mobile Rules)
Input & Display
NEVER use mouse events for touch interaction — Relying on InputEventMouseButton on mobile is unreliable. Always use InputEventScreenTouch and InputEventScreenDrag for high-fidelity multi-touch support.
NEVER ignore display safe areas (notches/cutouts) — UI placed behind a camera notch is unusable. Query DisplayServer.get_display_safe_area() and offset critical UI accordingly.
NEVER assume fixed orientation — Locking a landscape game without handling the size_changed signal leads to broken layouts on foldable devices or tablet orientation shifts.
Battery & Performance
NEVER maintain high framerate when backgrounded — Keeping an app at 60 FPS in the background drains battery. Use NOTIFICATION_APPLICATION_PAUSED to drop Engine.max_fps to 1.
NEVER use the Forward+ renderer for mobile — Most mobile GPUs are not optimized for Forward+. Use the dedicated Mobile or Compatibility renderers for optimal fill-rate.
NEVER leave 'ETC2/ASTC' texture compression disabled — Uncompressed desktop textures will crash mobile devices due to VRAM exhaustion.
Permissions & OS Integration
NEVER assume Android permissions are automatically granted — You MUST explicitly call OS.request_permission() and verify with OS.get_granted_permissions().
NEVER call handheld vibration without permission — On Android, vibration calls are ignored unless the VIBRATE permission is enabled in the export preset.
NEVER block the main thread for I/O — Large file saves on mobile can trigger ANR (Application Not Responding) errors. Use background threads.
Godot 4.7: Mobile
Built-in virtual joystick — native touch joystick without plugins for mobile builds.
HDR output on iOS and supported Android devices — test tonemapping on HDR panels.
Available Scripts
> MANDATORY: Pick the golden-path branch, then load only the matching scripts.
Golden path
Run the decision tree below (control × orientation × renderer).
Touch / stick → mobile_gesture_recognizer.gd (+ input skill for action maps). Built-in virtual joystick when sufficient.
ANR I/O — Large saves/loads on the main thread trip Android ANR. WHY: OS kills unresponsive apps. Gate: background threads / WorkerThreadPool for disk I/O.
Pause FPS — Backgrounded apps left at 60 FPS drain battery and heat the SoC. WHY: NOTIFICATION_APPLICATION_PAUSED must drop Engine.max_fps (see thermal_throttle_monitor.gd).
Permission timing — Request Android permissions at the feature moment (mic, photos), not on cold boot. WHY: Play policy + user trust; verify with OS.get_granted_permissions() via android_runtime_permissions.gd.
Expert notes (script-first)
Android Back: disable quit_on_go_back, handle NOTIFICATION_WM_GO_BACK_REQUEST in mobile_navigation_manager.gd.
Haptics: haptic_pattern_generator.gd / mobile_haptics.gd + export VIBRATE permission.
Shader hitch: mobile_shader_precompiler.gd; prefer godot-shaders-basics for deep precompile recipes.