tecs.gfx#

Overview#

Functions#

newCamera2Dfunction#

function(options: {
    x: number?,
    y: number?,
    zoom: number?,
    rotation: number?
}?): Camera2D

Creates a camera value for a View or coordinate conversion outside an entity.

Arguments#

options - { x: number?, y: number?, zoom: number?, rotation: number? }? : The caller supplies world position, positive zoom and radians of rotation.

Returns#

Camera2D

The camera value, centered at zero with zoom one by default.

Raises#

Type Condition
string when zoom is not positive or a value is not finite.

newCamera3Dfunction#

function(options: tecs.gfx.camera3d.Options?): Camera3D
Read-only binding

Creates a right-handed perspective camera looking along negative Z.

Arguments#

options - tecs.gfx.camera3d.Options?

Returns#

Camera3D

newTextfunction#

function(
    value: string?,
    font: Font?,
    size: number?,
    align: tecs.gfx.text.Align?,
    wrapWidth: number?
): Text
Read-only binding

Builds a text value that belongs to no entity, for measurement.

Arguments#

value - string?
the string to lay out, defaulting to empty
font - Font?
the font supplying the glyphs, or nil to draw nothing
size - number?
the em size in world units, defaulting to sixteen
align - tecs.gfx.text.Align?
the alignment, defaulting to "left"
wrapWidth - number?
the maximum line width in world units, defaulting to zero, which disables wrapping

Returns#

Text

the text value, which the caller owns

Raises#

Type Condition
string when the alignment is not one of its declared values, or when the wrap width is negative

newTTFfunction#

function(options: tecs.gfx.fonts.TTFOptions): (Font?, string?)
Read-only binding

Loads a TrueType font and reads its metrics.

Arguments#

options - tecs.gfx.fonts.TTFOptions

the source path or bytes, the identity, the raster point size, and the raster mode; name defaults to source, size to DEFAULT_SIZE, and raster to "sdf"

Returns#

Font?
the font, or nil when the file could not be read or parsed
string?
why the font could not be loaded, when unsuccessful

Raises#

Type Condition
string when neither source nor bytes is given, when the size is not greater than zero, or when the raster is not one of its declared values

Types#

Animationstruct#

struct Animation ...
@derive(types.debug)

Sprite-sheet playback state stored on an entity.

Members#

sheetfield#

sheet: integer

Caller-writable. Selects a sheet by its registration index. Zero plays nothing.

tagfield#

tag: integer

Caller-writable. Selects a tag by its Sheet.tagId index. Zero plays the whole sheet in order.

speedfield#

speed: number

Caller-writable. Multiplies the timing the sheet carries. One is the timing as authored and two is twice as fast. Zero or less holds the current frame and stops time advancing, which is a pause that leaves playing alone.

How long each frame is held is the sheet's answer rather than an entity's, because that is where an artist sets it: a hold frame is a frame with a long duration, which no single rate can express.

timefield#

time: number

Caller-writable. Supplies the phase used when frame is zero. To seek, write time and reset frame to zero. Read live phase with timeOf.

framefield#

frame: integer

Engine-owned. Holds -1 for encoded GPU playback, or zero to request re-encoding from time. Ordinary game code should call frameOf, which answers for an entity carrying no Animation too. Writing zero asks playback to rewrite the Sprite, which is what play, restart, of, and a restored snapshot do.

loopfield#

loop: boolean

Caller-writable. Controls whether the tag restarts after its last frame.

playingfield#

playing: boolean

Caller-writable. Controls whether time advances.

crossedfield#

crossed: integer

Engine-owned. Retains the serialized component layout; GPU playback leaves this legacy event scratch field at zero. Ordinary game code should observe Completed and Looped instead. The reporting system clears it, and a snapshot drops it.

Bounds3Dstruct#

struct Bounds3D ...
@derive(types.debug)

Stores the Bounds3D data for one 3D primitive.

Members#

centerXfield#

centerX: number

centerYfield#

centerY: number

centerZfield#

centerZ: number

radiusfield#

radius: number

Camera2Dstruct#

struct Camera2D ...
@derive(types.debug)

A view onto the world, in world units and target pixels.

Members#

instance methods

fields

xfield#

x: number

Caller-writable. Sets the horizontal center of the view in world units.

yfield#

y: number

Caller-writable. Sets the vertical center of the view in world units. Increasing y moves the view towards the bottom of the world.

zoomfield#

zoom: number

Caller-writable. Sets the zoom. Values above one magnify about the center without moving the point under the middle of the target.

rotationfield#

rotation: number

Caller-writable. Sets the rotation in radians. Positive values turn the scene counter-clockwise on screen.

matrixmethod#

function(borrows self: Camera2D, width: number, height: number): {number}

Returns the world-to-clip matrix for a viewport of width by height.

Column major, because that is how a shader reads a four-by-four uniform: the first four numbers are the first column, not the first row. Transposing them renders something plausible rather than nothing, which is how the mistake survives review.

The matrix owns the only y flip in the camera. toScreen and toWorld each spell out the same negated scale rather than sharing one helper, so a mismatch between the three stays visible.

Arguments#
borrows self - Camera2D
the camera to project through
width - number
the viewport width in target pixels
height - number
the viewport height in target pixels
Returns#
{number}

a fresh sixteen-number table the caller owns, indexed from one

viewBoundsmethod#

function(
    borrows self: Camera2D,
    width: number,
    height: number
): (number, number, number, number)

Returns the world rectangle this camera can see.

A rotated camera reports the axis-aligned box enclosing the view's corners, so culling keeps a little more than it must. Keeping too much costs a few instances; keeping too little drops geometry that should have drawn, which is why the error goes this way.

Arguments#
borrows self - Camera2D
the camera to bound
width - number
the viewport width in target pixels
height - number
the viewport height in target pixels
Returns#
number
the smallest x, then the smallest y, then the largest x, then the largest y
number
number
number

toWorldmethod#

function(
    borrows self: Camera2D,
    screenX: number,
    screenY: number,
    width: number,
    height: number
): (number, number)

Converts a target point to world space.

Arguments#
borrows self - Camera2D
the camera to project through
screenX - number
the pixels from the left of the viewport
screenY - number
the pixels from the top of the viewport, running down
width - number
the viewport width in target pixels, the same one the matrix was built with
height - number
the viewport height in target pixels, the same one the matrix was built with
Returns#
number
the world x, then the world y; a point outside the viewport converts too and lands outside the view rectangle
number

toScreenmethod#

function(
    borrows self: Camera2D,
    worldX: number,
    worldY: number,
    width: number,
    height: number
): (number, number)

Converts a world point to target space.

Exactly the inverse of toWorld at the same width and height, and the same mapping matrix applies, so a point round-trips.

Arguments#
borrows self - Camera2D
the camera to project through
worldX - number
the world x
worldY - number
the world y, running down
width - number
the viewport width in target pixels, the same one the matrix was built with
height - number
the viewport height in target pixels, the same one the matrix was built with
Returns#
number
the pixels from the left, then the pixels from the top; neither is clamped to the viewport
number

Camera3Drecord#

record Camera3D

A perspective camera with quaternion orientation.

Members#

xfield#

x: number

Caller-writable. Sets the world-space x coordinate.

yfield#

y: number

Caller-writable. Sets the world-space y coordinate.

zfield#

z: number

Caller-writable. Sets the world-space z coordinate.

rotationXfield#

rotationX: number

Caller-writable. Sets the local-to-world orientation quaternion x component.

rotationYfield#

rotationY: number

Caller-writable. Sets the local-to-world orientation quaternion y component.

rotationZfield#

rotationZ: number

Caller-writable. Sets the local-to-world orientation quaternion z component.

rotationWfield#

rotationW: number

Caller-writable. Sets the local-to-world orientation quaternion scalar component.

verticalFovfield#

verticalFov: number

Caller-writable. Sets the vertical field of view in radians between zero and pi.

nearfield#

near: number

Caller-writable. Sets the positive near-plane distance.

farfield#

far: number

Caller-writable. Sets the far-plane distance, which must exceed near.

matrixmethod#

function(
    exclusive self: Camera3D,
    width: number,
    height: number
): {[integer]: number}

Writes the column-major world-to-clip matrix for a viewport.

The method normalizes the camera quaternion while calculating the view, without modifying the caller's fields. Clip depth maps near to zero and far to one.

Arguments#
exclusive self - Camera3D
width - number
The positive viewport width in pixels.
height - number
The positive viewport height in pixels.
Returns#
{[integer]: number}

The camera's own sixteen-float array, valid until the next call on this camera.

inverseMatrixmethod#

function(
    exclusive self: Camera3D,
    width: number,
    height: number
): {[integer]: number}

Writes the column-major clip-to-world matrix for a viewport.

This is the exact inverse of matrix at the same dimensions. Clip x and y range from negative one to one, clip z ranges from zero to one, and the caller divides the resulting xyz by w.

Arguments#
exclusive self - Camera3D
width - number
The positive viewport width in pixels.
height - number
The positive viewport height in pixels.
Returns#
{[integer]: number}

The camera's own sixteen-float array, valid until the next call to inverseMatrix on this camera.

matricesmethod#

function(
    exclusive self: Camera3D,
    width: number,
    height: number
): ({[integer]: number}, {[integer]: number})

Writes the world-to-clip matrix and its clip-to-world inverse.

This method normalizes the camera quaternion and derives the projection once, then writes both arrays. Use it when both matrices describe the same view.

Arguments#
exclusive self - Camera3D
width - number
The positive viewport width in pixels.
height - number
The positive viewport height in pixels.
Returns#
{[integer]: number}
The camera's own world-to-clip sixteen-float array, valid until the next call to matrix or matrices on this camera.
{[integer]: number}
The camera's own clip-to-world sixteen-float array, valid until the next call to inverseMatrix or matrices on this camera.

Clipstruct#

struct Clip ...
@derive(types.debug)

A clip region selected by a renderable entity.

Members#

fields

indexfield#

index: integer

Caller-writable. Selects a region set with setRegion, from one to MAX - 1. Zero, the default, means no clipping.

DropShadow2Dstruct#

struct DropShadow2D ...
@derive(types.debug)

A stretched ground shadow, stored on a renderable entity.

Members#

fields

heightfield#

height: number

Caller-writable. Sets how far lights throw the shadow, from zero to one of the world's configured shadow height.

Fontrecord#

record Font

A loaded font and the atlas its glyphs live in.

Members#

namefield#

name: string

Read-only. Reports the identity a snapshot stores and find resolves.

sourcefield#

source: string

Read-only. Reports the path the bytes were read from, or the empty string for a font handed over as bytes.

sizefield#

size: number

Read-only. Reports the point size glyphs are rasterized at. It is not the size text is drawn at.

rasterfield#

raster: tecs.gfx.fonts.Raster

Read-only. Reports whether the atlas holds a distance field or direct coverage.

ascentfield#

ascent: number

Read-only. Reports the distance from the baseline to the top of the typographic ascent, in em units.

descentfield#

descent: number

Read-only. Reports the distance from the baseline to the bottom of the typographic descent, in em units. It is negative in every ordinary font.

lineGapfield#

lineGap: number

Read-only. Reports the extra leading between two lines, in em units.

lineHeightfield#

lineHeight: number

Read-only. Reports the baseline-to-baseline distance in em units, which is the ascent less the descent plus the leading.

Materialstruct#

struct Material ...
@derive(types.debug)

A material selection stored on a renderable entity.

Members#

fields

idfield#

id: integer

Caller-writable. Selects a material by an id id returned. Zero draws through textured.

paramfield#

param: number

Caller-writable. Passes a value from zero to one to the material. What it means is the material's business.

Meshstruct#

struct Mesh ...
@derive(types.debug)

Stores the Mesh data for one 3D primitive.

Members#

fields

modelfield#

model: integer

indexfield#

index: integer

MeshMaterialstruct#

struct MeshMaterial ...
@derive(types.debug)

Stores the MeshMaterial data for one 3D primitive.

Members#

fields

modelfield#

model: integer

indexfield#

index: integer

MeshMorphrecord#

record MeshMorph
@derive(types.debug)

Stores the MeshMorph data for one 3D primitive.

Members#

constructors

fields

constructorconstructor#

function(weights: {number}): tecs.gfx.MeshMorph

Constructs an instance from named fields. Optional fields may be omitted.

Arguments#
weights - {number}

Required.

Returns#
tecs.gfx.MeshMorph

the constructed instance

Examples#

Using values of the argument types above:

local value = require("tecs.gfx").MeshMorph(
    weights = weights
)

weightsfield#

weights: {number}

MeshSkinrecord#

record MeshSkin
@derive(types.debug)

Stores the MeshSkin data for one 3D primitive.

Members#

constructors

fields

constructorconstructor#

function(matrices: {number}): tecs.gfx.MeshSkin

Constructs an instance from named fields. Optional fields may be omitted.

Arguments#
matrices - {number}

Required.

Returns#
tecs.gfx.MeshSkin

the constructed instance

Examples#

Using values of the argument types above:

local value = require("tecs.gfx").MeshSkin(
    matrices = matrices
)

matricesfield#

matrices: {number}

Occluder2Dstruct#

struct Occluder2D ...
@derive(types.debug)

A silhouette that blocks light, stored on a renderable entity.

Members#

fields

heightfield#

height: number

Caller-writable. Sets the occluder height from zero to one of the world's configured shadow height.

PointLight2Dstruct#

struct PointLight2D ...
@derive(types.debug)

A light the deferred resolve accumulates.

Members#

heightfield#

height: number

Caller-writable. Sets the height above the surface plane in world units. At zero the Lambert term vanishes and the light contributes nothing.

radiusfield#

radius: number

Caller-writable. Sets the light's reach in world units. Falloff is smooth and reaches exactly zero at the radius.

rfield#

r: number

Caller-writable. Sets the red channel from zero to one.

gfield#

g: number

Caller-writable. Sets the green channel from zero to one.

bfield#

b: number

Caller-writable. Sets the blue channel from zero to one.

intensityfield#

intensity: number

Caller-writable. Scales the light's contribution. Values above one are meaningful, because the resolve writes a wider-than-eight-bit target.

PointLight3Dstruct#

struct PointLight3D ...
@derive(types.debug)

Omnidirectional mesh light positioned by Transform3D.

Members#

radiusfield#

radius: number

Caller-writable. Sets the positive reach in world units.

rfield#

r: number

Caller-writable. Sets non-negative linear red radiance.

gfield#

g: number

Caller-writable. Sets non-negative linear green radiance.

bfield#

b: number

Caller-writable. Sets non-negative linear blue radiance.

intensityfield#

intensity: number

Caller-writable. Scales non-negative radiance.

flagsfield#

flags: integer

Caller-writable. Combines LIGHT_* flags; zero disables shadow casting.

SpotLight3Dstruct#

struct SpotLight3D ...
@derive(types.debug)

Conical mesh light aimed along Transform3D local negative Z.

Members#

radiusfield#

radius: number

Caller-writable. Sets the positive reach in world units.

innerAnglefield#

innerAngle: number

Caller-writable. Sets the fully lit half-angle in radians.

outerAnglefield#

outerAngle: number

Caller-writable. Sets the cutoff half-angle in radians, below pi over two.

rfield#

r: number

Caller-writable. Sets non-negative linear red radiance.

gfield#

g: number

Caller-writable. Sets non-negative linear green radiance.

bfield#

b: number

Caller-writable. Sets non-negative linear blue radiance.

intensityfield#

intensity: number

Caller-writable. Scales non-negative radiance.

flagsfield#

flags: integer

Caller-writable. Combines LIGHT_* flags; zero disables shadow casting.

Spritestruct#

struct Sprite ...
@derive(types.debug)

An image region stored on a renderable entity.

Members#

fields

imagefield#

image: integer

Caller-writable. Selects an image by its tecs.gfx.images id. Zero selects no image.

u0field#

u0: number

Caller-writable. Sets the left edge of the sampled UV rectangle.

v0field#

v0: number

Caller-writable. Sets the top edge of the sampled UV rectangle.

u1field#

u1: number

Caller-writable. Sets the right edge of the sampled UV rectangle.

v1field#

v1: number

Caller-writable. Sets the bottom edge of the sampled UV rectangle.

Textrecord#

record Text

A string laid out into glyph entities.

Members#

constructorconstructor#

function(
    text: string,
    font: Font?,
    size: number,
    align: tecs.gfx.text.Align,
    wrapWidth: number,
    width: number,
    height: number
): tecs.gfx.Text

Constructs an instance from named fields. Optional fields may be omitted.

Arguments#
text - string
Required. Caller-writable. Sets the laid-out string. A newline starts a line and wrapWidth may introduce further breaks.
font - Font?
Optional. Defaults to nil. Caller-writable. Selects the font that supplies the glyphs. Without one, the text draws nothing.
size - number
Required. Caller-writable. Sets the em size in world units.
align - tecs.gfx.text.Align
Required. Caller-writable. Selects the alignment within the block's widest line.
wrapWidth - number
Required. Caller-writable. Sets the maximum line width in world units. Zero disables wrapping.
width - number
Required. Engine-owned. Reports the width of the last layout in world units, before the Transform2D scale. Assigning it has no effect.
height - number
Required. Engine-owned. Reports the height of the last layout in world units, on the same terms. Assigning it has no effect.
Returns#
tecs.gfx.Text

the constructed instance

Examples#

Using values of the argument types above:

local value = require("tecs.gfx").Text(
    text = text,
    size = size,
    align = align,
    wrapWidth = wrapWidth,
    width = width,
    height = height
)

textfield#

text: string

Caller-writable. Sets the laid-out string. A newline starts a line and wrapWidth may introduce further breaks.

fontfield#

font: Font?

Caller-writable. Selects the font that supplies the glyphs. Without one, the text draws nothing.

sizefield#

size: number

Caller-writable. Sets the em size in world units.

alignfield#

align: tecs.gfx.text.Align

Caller-writable. Selects the alignment within the block's widest line.

wrapWidthfield#

wrapWidth: number

Caller-writable. Sets the maximum line width in world units. Zero disables wrapping.

widthfield#

width: number

Engine-owned. Reports the width of the last layout in world units, before the Transform2D scale. Assigning it has no effect.

heightfield#

height: number

Engine-owned. Reports the height of the last layout in world units, on the same terms. Assigning it has no effect.

TileChunkstruct#

struct TileChunk ...

A native 16 by 16 grid of static atlas tiles.

Members#

tilesetfield#

tileset: integer

Caller-writable. Selects the atlas image.

tileWidthfield#

tileWidth: number

Caller-writable. Sets atlas tile width in pixels.

tileHeightfield#

tileHeight: number

Caller-writable. Sets atlas tile height in pixels.

columnsfield#

columns: integer

Caller-writable. Sets atlas columns.

spacingfield#

spacing: number

Caller-writable. Sets atlas tile spacing in pixels.

marginfield#

margin: number

Caller-writable. Sets atlas edge margin in pixels.

cellWidthfield#

cellWidth: number

Caller-writable. Sets horizontal cell spacing in world units.

cellHeightfield#

cellHeight: number

Caller-writable. Sets vertical cell spacing in world units.

offsetXfield#

offsetX: number

Caller-writable. Offsets tile images horizontally within cells.

offsetYfield#

offsetY: number

Caller-writable. Offsets tile images vertically within cells.

tilesfield#

tiles: uint32[257]

Caller-writable. Stores cells 1 through 256; element zero is unused.

Tintstruct#

struct Tint ...
@derive(types.debug)

A four-channel color stored on a renderable entity.

Members#

fields

rfield#

r: number

Caller-writable. Sets the red channel from zero to one.

gfield#

g: number

Caller-writable. Sets the green channel from zero to one.

bfield#

b: number

Caller-writable. Sets the blue channel from zero to one.

afield#

a: number

Caller-writable. Sets opacity from transparent at zero to opaque at one.

Viewrecord#

record View

Describes an ordered viewport with its own camera. Explicit views replace the synthesized full-frame camera; coordinates are fractions of the frame.

Members#

constructorconstructor#

function(
    camera2D: Camera2D?,
    camera3D: Camera3D?,
    lighting: tecs.gfx.meshes.Lighting,
    x: number,
    y: number,
    width: number,
    height: number,
    order: integer,
    enabled: boolean
): tecs.gfx.View

Constructs an instance from named fields. Optional fields may be omitted.

Arguments#
camera2D - Camera2D?
Optional. Defaults to nil. Caller-writable. Selects the camera drawn into this viewport.
camera3D - Camera3D?
Optional. Defaults to nil. Caller-writable. Selects a 3D camera, or nil to omit meshes.
lighting - tecs.gfx.meshes.Lighting
Required. Caller-writable. Controls mesh lighting in this viewport.
x - number
Optional. Defaults to 0. Caller-writable. Sets the left edge as a fraction of the frame.
y - number
Optional. Defaults to 0. Caller-writable. Sets the top edge as a fraction of the frame.
width - number
Optional. Defaults to 1. Caller-writable. Sets the width as a fraction of the frame.
height - number
Optional. Defaults to 1. Caller-writable. Sets the height as a fraction of the frame.
order - integer
Optional. Defaults to 0. Caller-writable. Sets composition order; equal orders use entity ID.
enabled - boolean
Optional. Defaults to true. Caller-writable. Enables this viewport.
Returns#
tecs.gfx.View

the constructed instance

Examples#

Using values of the argument types above:

local value = require("tecs.gfx").View(
    lighting = lighting
)

camera2Dfield#

camera2D: Camera2D?

Caller-writable. Selects the camera drawn into this viewport.

camera3Dfield#

camera3D: Camera3D?

Caller-writable. Selects a 3D camera, or nil to omit meshes.

lightingfield#

lighting: tecs.gfx.meshes.Lighting

Caller-writable. Controls mesh lighting in this viewport.

xfield#

x: number

Caller-writable. Sets the left edge as a fraction of the frame.

yfield#

y: number

Caller-writable. Sets the top edge as a fraction of the frame.

widthfield#

width: number

Caller-writable. Sets the width as a fraction of the frame.

heightfield#

height: number

Caller-writable. Sets the height as a fraction of the frame.

orderfield#

order: integer

Caller-writable. Sets composition order; equal orders use entity ID.

enabledfield#

enabled: boolean

Caller-writable. Enables this viewport.

Values#

ActiveCameravariable#

const ActiveCamera: tecs.ecs.Component

Selects the camera entity extraction projects the scene through.

Extraction reads the lowest live entity carrying both Camera2D and this tag. A world with no such entity draws through a camera centered on the render target at zoom one, which places world unit and target pixel on top of each other with the origin at the top left corner.

Animationvariable#

const Animation: tecs.ecs.ComponentDefinition<Animation>

Constructs playback state directly. Prefer tecs.gfx.animation.of, which resolves a sheet and a tag name for you.

AnimationEventsvariable#

const AnimationEvents: tecs.ecs.Component

Requests tecs.gfx.animation.Completed and tecs.gfx.animation.Looped for one entity.

Bounds3Dvariable#

const Bounds3D: tecs.ecs.ComponentDefinition<Bounds3D>

Constructs the Bounds3D component for a 3D primitive.

Camera2Dvariable#

const Camera2D: tecs.ecs.ComponentDefinition<Camera2D>

Constructs a camera centered on the world origin at zoom one.

Clipvariable#

const Clip: tecs.ecs.ComponentDefinition<Clip>

Constructs a clip selecting a region set with tecs.gfx.clips.setRegion.

DirtyTileChunkvariable#

const DirtyTileChunk

Requests synchronization after a nested tile-array edit.

DropShadow2Dvariable#

const DropShadow2D: tecs.ecs.ComponentDefinition<DropShadow2D>

Constructs a drop-shadow caster at full height.

LIGHT_CASTS_SHADOWSvariable#

const LIGHT_CASTS_SHADOWS: integer

Requests a slot in the local-light shadow atlas.

Materialvariable#

const Material: tecs.ecs.ComponentDefinition<Material>

Constructs a material selection, defaulting to textured at parameter one quarter.

Meshvariable#

const Mesh: tecs.ecs.ComponentDefinition<Mesh>

Constructs the Mesh component for a 3D primitive.

MeshMaterialvariable#

const MeshMaterial: tecs.ecs.ComponentDefinition<MeshMaterial>

Constructs the MeshMaterial component for a 3D primitive.

MeshMorphvariable#

const MeshMorph: components.TableComponent<MeshMorph>

Constructs the MeshMorph component for a 3D primitive.

MeshSkinvariable#

const MeshSkin: components.TableComponent<MeshSkin>

Constructs the MeshSkin component for a 3D primitive.

Occluder2Dvariable#

const Occluder2D: tecs.ecs.ComponentDefinition<Occluder2D>

Constructs an occluder at full height.

Pivotvariable#

const Pivot

Anchors a sprite at normalized X/Y coordinates or an authored sheet slice. Use Sheet:pivot to keep animated slice anchors synchronized with the GPU frames.

PointLight2Dvariable#

const PointLight2D: tecs.ecs.ComponentDefinition<PointLight2D>

Constructs a light at height sixty-four, reaching two hundred and fifty-six world units, in white at full strength.

PointLight3Dvariable#

const PointLight3D: tecs.ecs.ComponentDefinition<PointLight3D>

Constructs a point light with radius, linear RGB, intensity and LIGHT_* flags.

Renderable2Dvariable#

const Renderable2D: tecs.ecs.Component

Marks an entity as contributing geometry to the two-dimensional scene.

Renderable3Dvariable#

const Renderable3D

Marks geometry for the 3D renderer.

SpotLight3Dvariable#

const SpotLight3D: tecs.ecs.ComponentDefinition<SpotLight3D>

Constructs a spot light with radius, inner and outer half-angles in radians, linear RGB, intensity and LIGHT_* flags.

Spritevariable#

const Sprite: tecs.ecs.ComponentDefinition<Sprite>

Constructs a sprite whose omitted UV rectangle covers the whole image.

Textvariable#

const Text: tecs.ecs.ComponentDefinition<Text>

Constructs a text whose omitted fields default to an empty left-aligned string at em size sixteen with no wrapping.

TextGlyphvariable#

const TextGlyph: tecs.ecs.Component

Marks an entity as one glyph tecs.gfx.text placed for a Text.

TILE_CHUNK_SIZEvariable#

const TILE_CHUNK_SIZE: integer

The number of cells along a tile chunk edge.

TileChunkvariable#

const TileChunk: tecs.ecs.ComponentDefinition<TileChunk>

Constructs a tile chunk positioned by its top-left Transform2D.

Tintvariable#

const Tint: tecs.ecs.ComponentDefinition<Tint>

Constructs a tint whose omitted channels default to one.

Viewvariable#

const View: components.TableComponent<View>

Constructs a viewport from a camera and optional rectangle, order and enabled fields.