跳到正文
cccskills
免费在 GitHub 公开

godot-platform-mobile

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.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(18)

  • SKILL.md12.8 KB
  • references/migration-notes.md2.8 KB
  • references/mobile-touch-and-expert.md3.2 KB
  • scripts/adaptive_safe_area_inset.gd1.8 KB
  • scripts/android_runtime_permissions.gd1.6 KB
  • scripts/haptic_pattern_generator.gd1.4 KB
  • scripts/mobile_gesture_recognizer.gd2.1 KB
  • scripts/mobile_haptics.gd300 B
  • scripts/mobile_iap_flow_boilerplate.gd1.8 KB
  • scripts/mobile_navigation_manager.gd500 B
  • scripts/mobile_safe_area_handler.gd3.0 KB
  • scripts/mobile_sensor_fusion.gd1.4 KB
  • scripts/mobile_shader_precompiler.gd801 B
  • scripts/mobile_vram_optimizer.gd1.6 KB
  • scripts/native_share_invoker.gd1.5 KB
  • scripts/orientation_layout_adaptor.gd1.5 KB
  • scripts/platform_mobile_patterns.gd4.0 KB
  • scripts/thermal_throttle_monitor.gd1.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Platform: Mobile

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.

Available Scripts

MANDATORY: Pick the golden-path branch, then load only the matching scripts.

Golden path

  1. Run the decision tree below (control × orientation × renderer).
  2. Touch / stick → mobile_gesture_recognizer.gd (+ input skill for action maps). Built-in virtual joystick when sufficient.
  3. Layout / notches → adaptive_safe_area_inset.gd + orientation_layout_adaptor.gd.
  4. Lifecycle / thermal → thermal_throttle_monitor.gd (pause FPS + heat).
  5. Permissions / share / IAP → android_runtime_permissions.gd, native_share_invoker.gd, mobile_iap_flow_boilerplate.gd as needed.
  6. VRAM / compression → mobile_vram_optimizer.gd.

Script index

mobile_gesture_recognizer.gd

Expert multi-touch logic for pinch-to-zoom and two-finger rotation.

adaptive_safe_area_inset.gd

Dynamic safe-area (notch) handling using DisplayServer insets.

thermal_throttle_monitor.gd

Battery and heat management via NOTIFICATION_APPLICATION_PAUSED.

mobile_iap_flow_boilerplate.gd

Unified boilerplate for Android/iOS In-App Purchases (IAP).

haptic_pattern_generator.gd

Advanced vibration patterns for mobile haptic feedback.

android_runtime_permissions.gd

Expert Android permission requesting and verification logic.

mobile_sensor_fusion.gd

Stable motion controls using Accelerometer and Gravity fusion.

orientation_layout_adaptor.gd

Adaptive UI swapping for Landscape/Portrait transitions.

mobile_vram_optimizer.gd

VRAM monitoring and texture compression enforcement rules.

native_share_invoker.gd

OS-level native share sheet integration for social features.

platform_mobile_patterns.gd / mobile_safe_area_handler.gd

Additional patterns / legacy safe-area helper — load only if golden-path scripts insufficient.


Decision tree (before implementation)

AxisChooseImplies
Control schemeTap/gesture vs virtual stick vs tiltGestures → mobile_gesture_recognizer.gd; stick → built-in joystick / Control stick; tilt → mobile_sensor_fusion.gd
OrientationLocked landscape / portrait / adaptiveAdaptive → MANDATORY orientation_layout_adaptor.gd + size_changed
RendererMobile vs CompatibilityNever Forward+ on phone GPUs; ETC2/ASTC on; precompile shaders on load screens

Touch input uses InputEventScreenTouch / InputEventScreenDrag — not mouse emulation.

Project settings (mobile)

[rendering]
renderer/rendering_method="mobile"
textures/vram_compression/import_etc2_astc=true

[display]
window/handheld/orientation="landscape"

App Store Metadata

  • Icons: 512×512 (Android), 1024×1024 (iOS); multi-res screenshots; privacy policy; age rating.

Ship-gate checks (WHY)

  1. 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.
  2. 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).
  3. 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)

Deep dives (on demand)

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

  • Using InputEvent — Event pipeline that makes InputEventScreenTouch / InputEventScreenDrag the correct mobile path instead of mouse-button emulation.
  • Input examples — Multi-touch, drag, and gesture patterns behind virtual joysticks, pinch/rotate, and swipe HUDs.
  • Handling quit requests — NOTIFICATION_APPLICATION_PAUSED / resume and Android back (WM_GO_BACK_REQUEST) lifecycle that replaces desktop quit assumptions.
  • DisplayServer — get_display_safe_area(), orientation, and virtual keyboard APIs for notches, foldables, and OSK occlusion.
  • OS — request_permission() / get_granted_permissions(), feature tags, and memory queries used by Android runtime gates and VRAM watchdogs.
  • Input — vibrate_handheld(), accelerometer/gravity/gyroscope fusion, and touch↔mouse emulation toggles.
  • Exporting for Android — Permissions (including VIBRATE), APK/AAB, and store packaging constraints after platform code is ready.
  • Exporting for iOS — Xcode export, capabilities, and App Store gates that catch missing privacy/plugin setup late.
  • Android in-app purchases — Official Play Billing flow that the IAP boilerplate script abstracts with iOS store plugins.
  • Introduction to the 3 rendering methods — Why mobile builds should prefer Mobile or Compatibility over Forward+ for fill-rate and feature set.
  • Multiple resolutions — Stretch modes, content scale, and orientation-safe layouts for phone/tablet aspect changes.
  • Feature tags — mobile / android / ios branching for permissions, share sheets, and platform-only singletons.

Related Skills

Prerequisites

  • godot-input-handling — Shared InputEvent buffering, multi-touch indices, and deadzones before shipping gesture recognizers or virtual sticks.
  • godot-ui-containers — Anchors, Margin/Box containers, and minimum sizes so safe-area insets and 44–48px touch targets stay layout-correct.
  • godot-project-foundations — Feature tags, display stretch, and renderer defaults every Android/iOS export branch depends on.

Complements

  • godot-adapt-desktop-to-mobile — Desktop→touch control remap, joystick spawners, and UI scaling that pair with this skill's deeper OS/permission APIs.
  • godot-performance-optimization — Profiling and CPU/GPU cuts when thermal FPS caps and ETC2/ASTC alone still miss mid-range budgets.
  • godot-save-load-systems — Durable save ownership hooked to pause/resume instead of desktop-only quit notifications.
  • godot-autoload-architecture — Singleton homes for permissions, haptics, thermal monitors, and always-on pause handlers.
  • godot-audio-systems — Bus mute/duck on APPLICATION_PAUSED so background audio does not keep the device warm.
  • godot-shaders-basics — Cheaper CanvasItem/Spatial shader paths and precompile strategies that avoid mobile hitch spikes.
  • godot-tweening — Smooth UI lifts when the OS virtual keyboard covers LineEdits during mobile text entry.
  • godot-platform-desktop — Keep mouse/keyboard paths correct when the same project remains dual-input beside mobile feature tags.

Downstream / consumers

  • godot-export-builds — Signing, CI presets, and store packaging after touch/safe-area/permission gates pass on devices.
  • godot-genre-puzzle — Tap/swipe/pinch control schemes that consume mobile gesture and safe-area HUD patterns.
  • godot-economy-system — Soft/hard currency and receipt-validated IAP products once Play Billing / App Store plugins are wired.

Master

  • godot-master — Library router and mirrored module entry for discovering this platform skill beside sibling domains.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Bevy ECS skill for 2D sprite animation. Keywords: Bevy, sprite, animation, AnimationPlayer, AnimationClip, 2D.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

Spawn and tune Bevy 0.20 directional, point, and spot lights, cascade shadows, distance fog, and a nearest-light shadow budget. Use when a 3D scene needs a sun, local lights, or fog on the camera. Keywords: DirectionalLight, PointLight, SpotLight, CascadeShadowConfig, DistanceFog, bevy_light.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

Bevy ECS skill for PBR materials. Keywords: Bevy, StandardMaterial, PBR, material, ExtendedMaterial.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

Bevy ECS skill for 3D level assembly. Keywords: Bevy, level, scene, mesh, world, ECS.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

Bevy ECS skill for abilities. Keywords: Bevy, ability, cooldown, ECS, gameplay.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

Rewrite Bevy 2D actors and cameras into 3D meshes and Camera3d while keeping gameplay components. Use when a Bevy 2D game should gain a perspective camera, mesh draw, and a planar velocity lifted onto XZ. Keywords: Camera2d, Camera3d, Sprite, Mesh3d, StandardMaterial, WishVelocity.

中文简介正在准备中。当前显示原文说明。

thedivergentai/Game-Dev-Agentic-Skills8852026年10月17日 更新

查看 thedivergentai 的全部技能

报告此技能的问题