Prefabs
@shell/pixi provides render bundles and a camera prefab. Render bundles contain public intent and
layout data; the runtime transform group arrives through required-component relationships.
Image includes Sprite, Texture, Size, Position, and Anchor.
TextLabel
Section titled “TextLabel”TextLabel includes Text, Size, Pivot, and Position. Adding Text automatically adds
PixiTransformGroup; the bundle does not manually include runtime plumbing.
CameraPrefab
Section titled “CameraPrefab”export const CameraPrefab = Define.prefab().with(Camera, Position, Rotation);A prefab bundling the three components needed for a functional camera. Position and Rotation
are canonical @shell/transform components used internally by the Pixi camera systems.
| Component | Purpose |
|---|---|
Camera | Zoom level |
Position | Position in world space |
Rotation | Rotation around Z axis |
Default spawn
Section titled “Default spawn”When PixiPlugin is added with spawnCamera: true (the default), a camera entity is spawned automatically during startup:
world.addPlugin(PixiPlugin); // spawns CameraPrefabThe spawned entity has default values for all components:
Camera.zoom = 1Position.x = 0,Position.y = 0,Position.z = 0Rotation.x = 0,Rotation.y = 0,Rotation.z = 0
Custom camera
Section titled “Custom camera”To create a camera with custom initial values, disable the default spawn and spawn your own:
import { Define } from '@shell/ecs';import { Camera, PixiPlugin } from '@shell/pixi';import { Position, Rotation } from '@shell/transform';
world.addPlugin(PixiPlugin, { spawnCamera: false });
commands.spawn( Define.prefab() .with(Camera, { zoom: 2 }) .with(Position, { x: 0, y: 0, z: 0 }) .with(Rotation, { x: 0, y: 0, z: 0 }),);Only one camera entity is needed. The CameraSync system applies the first matching camera’s transform to the world container.