Skip to content

Image

A flat textured plane that auto-sizes to the loaded image's aspect ratio. Useful for billboards, UI quads, or photo planes.

ts
import { Behaviour } from "@relu-interactives/spatial-ecs";

export default class SpawnPoster extends Behaviour {
  init() {
    const objects = this.world.getObjectManagementSystem();
    objects?.requestCreate("image", {
      name: "Poster",
      path: "/assets/images/poster.png",
      transform: { position: { x: 0, y: 1.5, z: -2 } },
    });
  }
}

Payload

FieldTypeDefaultDescription
namestring"Image"Display name.
pathstring""URL or local-asset path to the image (PNG / JPG).
transformTransformDataidentityPosition / rotation / scale.
parentIdEntityId | nullnullOptional parent entity.

The plane is created at 1×1 and rescaled in X by width / height once the texture loads.

Components attached

Transform, Object3DRef, Name, EntityType, ParentId, Selectable, Image.