components.module
This package holds more than this page lists. See all of its files in its world.
README.md
ecs.Camera
Spec for the Camera component, which maps to the native Camera. Makes an entity a render viewpoint, with a configurable projection, render priority, layer selection, and an optional offscreen render target.
Fields
enabled— whether the camera renders.fov,near,far— perspective projection parameters.fovis the angle in degrees across the side of the framefovAxisnames.fovAxis—"shorter"(default: vertical in a landscape frame, horizontal in a portrait one),"vertical"or"horizontal".priority— orders multiple cameras.textureHandle— arenderer.texture.create({ width, height })handle the camera renders into; absent means the main viewport.layerIncludeMask— render-layer include bitmask; a layer draws into this camera only when its bit is set. TheCameracomponent resolves itsrenderLayersname spec (e.g."all !ui") down to this raw mask.debugChannel— debug visualization channel.
Methods
scheduleRender(output, priority, fov, near, far, projection?)— schedule a single render of this camera intooutput(the"viewport"target or a named offscreen handle) for the current frame, at the given priority and projection.projectionis{ projection, orthoHeight, fovAxis }.
entity(id).component.add("Camera", { fov = 60, near = 0.1, far = 1000 })
entity(id).component.Camera:scheduleRender("viewport", 0, 60, 0.1, 1000)