API Reference

Vue Components

Public component surface for PhaserGame, PhaserScene, and the alpha primitive set.

PhaserGame

PhaserGame owns Phaser.Game and provides the per-instance scope.

width and height size both the outer host element and the Phaser canvas mount. Use percentage values such as 100% when the parent already owns layout.

Key props:

  • config
  • scenes
  • width
  • height
  • pixelArt
  • transparent
  • backgroundColor
  • autoFocus
  • autoStart
  • instanceId
  • debug
  • suspendWhenHidden
  • hmrStrategy
  • assetsBaseUrl

Events:

  • ready
  • destroyed
  • error

Exposed refs:

  • game
  • mounted
  • containerEl
  • bridge

PhaserScene

PhaserScene registers a managed scene with the nearest PhaserGame.

Props:

  • sceneKey
  • definition
  • active
  • visible
  • autoStart

Primitive components

The alpha primitives are:

  • PhaserContainer
  • PhaserImage
  • PhaserSprite
  • PhaserText

All primitives:

  • create exactly one Phaser object
  • wait until the active scene is ready
  • support @ready
  • destroy cleanly on unmount
  • expose the raw object through refs
The primitives are a convenience layer, not a renderer. Constructor-only identity changes warn instead of hiding a destroy-and-recreate cycle.
Copyright © 2026