Building a Joystick Controller using Compose Multiplatform
summary
A working on‑screen joystick and full gamepad is implemented with Compose Multiplatform Gesture APIs using pointerInput and awaitPointerEventScope then routed through a single immutable gamepad state and per‑control handlers. Direction uses theta from atan2 and a polar to Cartesian conversion to cap the thumb at a fixed radius, D‑pad yields eight discrete values while analog gives continuous offsets, face buttons use circle packing, haptics use expect/actual generators, code is open source and demo runs on cloud gaming for iOS and Android.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:48Jam.gg controller challenges
- 2:31Compose gesture APIs
- 5:47First joystick prototype
- 7:53Joystick with trigonometry
- 15:17Full gamepad controls
- 18:07Input state architecture
- 23:08D-pad and analog controls
- 28:06Face buttons design
- 30:55Haptic feedback UX
- 33:22Gamepad layout
- 34:26Open-sourcing library
- 35:07Cross-platform demo
- 38:45Q&A
related talks
33mGoing 100%* Compose Multiplatform
58mMultiplatform UI: Compose outside Android
37mCreative Coding with Kotlin
40mCompose Multiplatform: Better Shared UI for iOS and Beyond
34mHardware development with KMP and Compose Desktop
45mCompose Multiplatform on iOS
32mJetpack Compose — Next Gen Kotlin UI Toolkit for Android
43mCompose Multiplatform for iOS: Ready for Production Use
