- DocC catalog (Sources/PlayDate/PlayDate.docc) with a curated landing page and a Getting Started article; swift-docc-plugin wired up for `swift package generate-documentation`, and a GitHub Pages deployment workflow renders docs on every push to main. - Examples/HelloPlaydate: a minimal game (bouncing box, crank needle, button handling, system menu item) whose build.sh compiles the game as a dylib and produces a runnable simulator .pdx via the SDK's pdc. Verified: the pdx builds and exports the eventHandler entry point. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
PlayDate
Swift bindings to the Playdate C API.
Overview
The Playdate C API is delivered as a PlaydateAPI* struct of function
pointers that the firmware hands to your game at launch. This module wraps
that surface in idiomatic Swift: top-level namespaces per subsystem, wrapper
types with ownership semantics, closures instead of function-pointer/userdata
pairs, OptionSets and enums instead of raw constants, and typed throws
for fallible calls.
Call Playdate/initialize(with:) from your game's eventHandler before
using anything else — see doc:GettingStarted.
The bindings are written within the Embedded Swift subset, so the same code
compiles for the Playdate Simulator and for the device
(armv7em-none-none-eabi).
Topics
Essentials
- doc:GettingStarted
PlaydateSystemEventPlaydateError
System and display
SystemDisplay
Drawing
GraphicsRect
Sprites
Sprite
Audio
Sound
Storage
FileJSON
Connectivity
NetworkScoreboardsAccessReply
Lua interop
Lua