Godot adapt desktop to mobile

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot adapt desktop to mobile is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert patterns for porting desktop games to mobile including touch control schemes (virtual joystick, gesture detection), UI scaling for small screens, performance optimization for mobile GPUs, battery life management, and platform-specific features. Use when creating mobile ports or cross-platform

How to use this skill

Skill file

Adapt: Desktop to Mobile

Expert guidance for porting desktop games to mobile platforms.

NEVER Do


Available Scripts

MANDATORY: Read the appropriate script before implementing the corresponding pattern. Do not paste joystick/gesture/UI tutorials inline.

[dynamic_joystick_spawner.gd](scripts/dynamic_joystick_spawner.gd)

MANDATORY for move sticks — Joystick appears where the user touches the left half (prefer over fixed-position recipes).

[virtual_joystick.gd](scripts/virtual_joystick.gd)

Fixed-base stick Control — use when UI art requires a static well; otherwise prefer dynamic_joystick_spawner.

[gesture_combo_system.gd](scripts/gesture_combo_system.gd)

MANDATORY for swipe/pinch — Duration/distance/multi-touch ratio → signals.

[mobile_ui_adapter.gd](scripts/mobile_ui_adapter.gd)

MANDATORY for Control remaps — Scales/reanchors desktop HUD for thumb reach + density.

[resolution_scaler.gd](scripts/resolution_scaler.gd)

Adaptive scaling_3d_scale to hold 60FPS while keeping 2D UI sharp.

[battery_saver_mode.gd](scripts/battery_saver_mode.gd)

MANDATORY — NOTIFICATION_APPLICATION_PAUSED → Engine.max_fps = 1 + pause physics.

[ui_safe_area_margins.gd](scripts/ui_safe_area_margins.gd)

DisplayServer.get_display_safe_area() padding for notches / hole-punch.

[touch_camera_pan_zoom.gd](scripts/touch_camera_pan_zoom.gd)

1-finger pan + 2-finger pinch Camera2D.

[haptic_feedback_manager.gd](scripts/haptic_feedback_manager.gd)

Input.vibrate_handheld + iOS plugin hook pattern.

[mobile_shader_fallback.gd](scripts/mobile_shader_fallback.gd)

Strip SSS/clearcoat/heavy shading on weak mobile renderers.

[on_screen_keyboard_handler.gd](scripts/on_screen_keyboard_handler.gd)

Virtual keyboard occlusion → tween UI up. Use for LineEdit/TextEdit focus — not a substitute for HUD scaling.

[mobile_ui_adapter.gd](scripts/mobile_ui_adapter.gd) vs on_screen_keyboard_handler

| Need | Script |

|------|--------|

| Scale/reanchor HUD, spawn virtual sticks, thumb-reach density | mobile_ui_adapter |

| OS virtual keyboard covers focused text field | on_screen_keyboard_handler (often both: adapter for layout, OSK handler for text fields) |

[offline_save_sync.gd](scripts/offline_save_sync.gd)

MANDATORY — Persist on App Pause (WM_CLOSE is unreliable on mobile kill).


Touch Control Schemes

Decision Matrix

| Genre | Recommended Control | Script |

|-------|-------------------|--------|

| Platformer | Virtual joystick (left) + jump button (right) | dynamic_joystick_spawner / virtual_joystick |

| Top-down shooter | Dual-stick (move left, aim right) | dynamic_joystick_spawner ×2 |

| Turn-based | Direct tap on units/tiles | gesture_combo_system (tap) |

| Puzzle | Tap, swipe, pinch | gesture_combo_system |

| Card game | Drag-and-drop | mobile_ui_adapter + drag Controls |

| Racing | Tilt or tap left/right | platform-mobile / Input sensors |

Port Procedure (ordered)

  1. MANDATORY mobile-port-checklist.md — confirm pre-port inventory and gate rows before remapping controls.
  2. Replace hover/right-click/scroll with touch equivalents (decision matrix).
  3. MANDATORY safe-area + mobile_ui_adapter for 44–48dp targets; keep critical HUD above fingers.
  4. Hook battery_saver_mode + offline_save_sync on pause/resume.
  5. Enable resolution_scaler + mobile_shader_fallback until device FPS is stable.
  6. Deep Android/iOS IAP/permissions → godot-platform-mobile (Do NOT Load full platform skill until control/UI/perf gates pass).

Edge Cases (checklist)

Device testing (before ship)

Full port recipes → mobile-port-deep.md.

Deep Recipes

MANDATORY when porting beyond the decision matrix: read mobile-port-deep.md. Do NOT Load it for a first-pass control remap.

Expert Techniques (short)

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API;

load Related Skills when routing work to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.