Skip to content

About the API reference

The reference pages are generated from the TypeScript sources of the two packages every time this site is built, with TypeDoc: they say exactly what the code says, and change with it.

  • @fabiplay/sdk: connect(), the Play object, the simple API (Easy, which is what window.FabiPlay is), the keyboard and pointer adapters, drawAvatar, and the protocol’s types (PlayerFrame, Body, GameManifest, …).
  • @fabiplay/engine: createEngine(), the Engine, the nodes (Sprite, Shape, Text, Group, Particles, AnimatedSprite), tweens and timelines, bitmap fonts, sound, tiers, createAvatarRenderer() and avatarPortrait().

The same documentation ships inside the packages: every public function and field has its comment in the declaration files, so hovering a call in VS Code or WebStorm shows it. For script-tag games, fabi-play.d.ts and fabi-play-engine.lite.d.ts declare the globals FabiPlay and FabiEngine with the same types (see TypeScript types).

Some exported names are building blocks the engine itself is made of (Atlas, ShelfPacker, AvatarPainter, createRenderer, Tweens, …). A game rarely needs them: start from the engine guide.