Sprite
A camera-facing THREE.Sprite textured with an image. Always faces the active camera.
ts
import { Behaviour } from "@relu-interactives/spatial-ecs";
export default class SpawnIcon extends Behaviour {
init() {
const objects = this.world.getObjectManagementSystem();
objects?.requestCreate("sprite", {
name: "Marker",
path: "/assets/images/marker.png",
transform: { position: { x: 0, y: 2, z: 0 } },
});
}
}Payload
| Field | Type | Default | Description |
|---|---|---|---|
name | string | "Sprite" | Display name. |
path | string | "" | URL or local-asset path to the sprite image. |
transform | TransformData | identity | Position / rotation / scale. |
parentId | EntityId | null | null | Optional parent entity. |
Components attached
Transform, Object3DRef, Name, EntityType, ParentId, Selectable, Sprite.

