tecs.gfx#
Overview#
functions
submodules
animationcamera3dclipsflycamera3dfontsframetableimageslayerslightingmeshesmodelsparticlesscreenshotsheettexttruetype
types
AnimationBounds3DCamera2DCamera3DClipDropShadow2DFontMaterialMeshMeshMaterialMeshMorphMeshSkinOccluder2DPointLight2DPointLight3DSpotLight3DSpriteTextTileChunkTintView
values
Functions#
newCamera2Dfunction#
function(options: {
x: number?,
y: number?,
zoom: number?,
rotation: number?
}?): Camera2DCreates 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?): Camera3DCreates a right-handed perspective camera looking along negative Z.
Arguments#
options-tecs.gfx.camera3d.Options?
Returns#
newTextfunction#
function(
value: string?,
font: Font?,
size: number?,
align: tecs.gfx.text.Align?,
wrapWidth: number?
): TextBuilds 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?)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;namedefaults tosource,sizetoDEFAULT_SIZE, andrasterto"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 ...Sprite-sheet playback state stored on an entity.
Members#
sheetfield#
sheet: integerCaller-writable. Selects a sheet by its registration index. Zero plays nothing.
tagfield#
tag: integerCaller-writable. Selects a tag by its Sheet.tagId index. Zero plays the whole sheet in order.
speedfield#
speed: numberCaller-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: numberCaller-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: integerEngine-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: booleanCaller-writable. Controls whether the tag restarts after its last frame.
playingfield#
playing: booleanCaller-writable. Controls whether time advances.
crossedfield#
crossed: integerEngine-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 ...Stores the Bounds3D data for one 3D primitive.
Members#
centerXfield#
centerX: numbercenterYfield#
centerY: numbercenterZfield#
centerZ: numberradiusfield#
radius: numberCamera2Dstruct#
struct Camera2D ...A view onto the world, in world units and target pixels.
Members#
xfield#
x: numberCaller-writable. Sets the horizontal center of the view in world units.
yfield#
y: numberCaller-writable. Sets the vertical center of the view in world units. Increasing y moves the view towards the bottom of the world.
zoomfield#
zoom: numberCaller-writable. Sets the zoom. Values above one magnify about the center without moving the point under the middle of the target.
rotationfield#
rotation: numberCaller-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
numbernumbernumber
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 Camera3DA perspective camera with quaternion orientation.
Members#
xfield#
x: numberCaller-writable. Sets the world-space x coordinate.
yfield#
y: numberCaller-writable. Sets the world-space y coordinate.
zfield#
z: numberCaller-writable. Sets the world-space z coordinate.
rotationXfield#
rotationX: numberCaller-writable. Sets the local-to-world orientation quaternion x component.
rotationYfield#
rotationY: numberCaller-writable. Sets the local-to-world orientation quaternion y component.
rotationZfield#
rotationZ: numberCaller-writable. Sets the local-to-world orientation quaternion z component.
rotationWfield#
rotationW: numberCaller-writable. Sets the local-to-world orientation quaternion scalar component.
verticalFovfield#
verticalFov: numberCaller-writable. Sets the vertical field of view in radians between zero and pi.
nearfield#
near: numberCaller-writable. Sets the positive near-plane distance.
farfield#
far: numberCaller-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-Camera3Dwidth-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-Camera3Dwidth-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
inverseMatrixon 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-Camera3Dwidth-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
matrixormatriceson this camera. {[integer]: number}- The camera's own clip-to-world sixteen-float array, valid until the next call to
inverseMatrixormatriceson this camera.
Clipstruct#
struct Clip ...A clip region selected by a renderable entity.
Members#
fields
indexfield#
index: integerCaller-writable. Selects a region set with setRegion, from one to MAX - 1. Zero, the default, means no clipping.
DropShadow2Dstruct#
struct DropShadow2D ...A stretched ground shadow, stored on a renderable entity.
Members#
fields
heightfield#
height: numberCaller-writable. Sets how far lights throw the shadow, from zero to one of the world's configured shadow height.
Fontrecord#
record FontA loaded font and the atlas its glyphs live in.
Members#
namefield#
name: stringRead-only. Reports the identity a snapshot stores and find resolves.
sourcefield#
source: stringRead-only. Reports the path the bytes were read from, or the empty string for a font handed over as bytes.
sizefield#
size: numberRead-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: numberRead-only. Reports the distance from the baseline to the top of the typographic ascent, in em units.
descentfield#
descent: numberRead-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: numberRead-only. Reports the extra leading between two lines, in em units.
lineHeightfield#
lineHeight: numberRead-only. Reports the baseline-to-baseline distance in em units, which is the ascent less the descent plus the leading.
Materialstruct#
struct Material ...A material selection stored on a renderable entity.
Members#
idfield#
id: integerCaller-writable. Selects a material by an id id returned. Zero draws through textured.
paramfield#
param: numberCaller-writable. Passes a value from zero to one to the material. What it means is the material's business.
Meshstruct#
struct Mesh ...Stores the Mesh data for one 3D primitive.
Members#
modelfield#
model: integerindexfield#
index: integerMeshMaterialstruct#
struct MeshMaterial ...Stores the MeshMaterial data for one 3D primitive.
Members#
modelfield#
model: integerindexfield#
index: integerMeshMorphrecord#
record MeshMorphStores the MeshMorph data for one 3D primitive.
Members#
constructorconstructor#
function(weights: {number}): tecs.gfx.MeshMorphConstructs 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 MeshSkinStores the MeshSkin data for one 3D primitive.
Members#
constructorconstructor#
function(matrices: {number}): tecs.gfx.MeshSkinConstructs 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 ...A silhouette that blocks light, stored on a renderable entity.
Members#
fields
heightfield#
height: numberCaller-writable. Sets the occluder height from zero to one of the world's configured shadow height.
PointLight2Dstruct#
struct PointLight2D ...A light the deferred resolve accumulates.
Members#
heightfield#
height: numberCaller-writable. Sets the height above the surface plane in world units. At zero the Lambert term vanishes and the light contributes nothing.
radiusfield#
radius: numberCaller-writable. Sets the light's reach in world units. Falloff is smooth and reaches exactly zero at the radius.
rfield#
r: numberCaller-writable. Sets the red channel from zero to one.
gfield#
g: numberCaller-writable. Sets the green channel from zero to one.
bfield#
b: numberCaller-writable. Sets the blue channel from zero to one.
intensityfield#
intensity: numberCaller-writable. Scales the light's contribution. Values above one are meaningful, because the resolve writes a wider-than-eight-bit target.
PointLight3Dstruct#
struct PointLight3D ...Omnidirectional mesh light positioned by Transform3D.
Members#
radiusfield#
radius: numberCaller-writable. Sets the positive reach in world units.
rfield#
r: numberCaller-writable. Sets non-negative linear red radiance.
gfield#
g: numberCaller-writable. Sets non-negative linear green radiance.
bfield#
b: numberCaller-writable. Sets non-negative linear blue radiance.
intensityfield#
intensity: numberCaller-writable. Scales non-negative radiance.
flagsfield#
flags: integerCaller-writable. Combines LIGHT_* flags; zero disables shadow casting.
SpotLight3Dstruct#
struct SpotLight3D ...Conical mesh light aimed along Transform3D local negative Z.
Members#
fields
radiusfield#
radius: numberCaller-writable. Sets the positive reach in world units.
innerAnglefield#
innerAngle: numberCaller-writable. Sets the fully lit half-angle in radians.
outerAnglefield#
outerAngle: numberCaller-writable. Sets the cutoff half-angle in radians, below pi over two.
rfield#
r: numberCaller-writable. Sets non-negative linear red radiance.
gfield#
g: numberCaller-writable. Sets non-negative linear green radiance.
bfield#
b: numberCaller-writable. Sets non-negative linear blue radiance.
intensityfield#
intensity: numberCaller-writable. Scales non-negative radiance.
flagsfield#
flags: integerCaller-writable. Combines LIGHT_* flags; zero disables shadow casting.
Spritestruct#
struct Sprite ...An image region stored on a renderable entity.
Members#
imagefield#
image: integerCaller-writable. Selects an image by its tecs.gfx.images id. Zero selects no image.
u0field#
u0: numberCaller-writable. Sets the left edge of the sampled UV rectangle.
v0field#
v0: numberCaller-writable. Sets the top edge of the sampled UV rectangle.
u1field#
u1: numberCaller-writable. Sets the right edge of the sampled UV rectangle.
v1field#
v1: numberCaller-writable. Sets the bottom edge of the sampled UV rectangle.
Textrecord#
record TextA 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.TextConstructs 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
wrapWidthmay 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
Transform2Dscale. 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: stringCaller-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: numberCaller-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: numberCaller-writable. Sets the maximum line width in world units. Zero disables wrapping.
widthfield#
width: numberEngine-owned. Reports the width of the last layout in world units, before the Transform2D scale. Assigning it has no effect.
heightfield#
height: numberEngine-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: integerCaller-writable. Selects the atlas image.
tileWidthfield#
tileWidth: numberCaller-writable. Sets atlas tile width in pixels.
tileHeightfield#
tileHeight: numberCaller-writable. Sets atlas tile height in pixels.
columnsfield#
columns: integerCaller-writable. Sets atlas columns.
spacingfield#
spacing: numberCaller-writable. Sets atlas tile spacing in pixels.
marginfield#
margin: numberCaller-writable. Sets atlas edge margin in pixels.
cellWidthfield#
cellWidth: numberCaller-writable. Sets horizontal cell spacing in world units.
cellHeightfield#
cellHeight: numberCaller-writable. Sets vertical cell spacing in world units.
offsetXfield#
offsetX: numberCaller-writable. Offsets tile images horizontally within cells.
offsetYfield#
offsetY: numberCaller-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 ...A four-channel color stored on a renderable entity.
Members#
rfield#
r: numberCaller-writable. Sets the red channel from zero to one.
gfield#
g: numberCaller-writable. Sets the green channel from zero to one.
bfield#
b: numberCaller-writable. Sets the blue channel from zero to one.
afield#
a: numberCaller-writable. Sets opacity from transparent at zero to opaque at one.
Viewrecord#
record ViewDescribes 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.ViewConstructs 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: numberCaller-writable. Sets the left edge as a fraction of the frame.
yfield#
y: numberCaller-writable. Sets the top edge as a fraction of the frame.
widthfield#
width: numberCaller-writable. Sets the width as a fraction of the frame.
heightfield#
height: numberCaller-writable. Sets the height as a fraction of the frame.
orderfield#
order: integerCaller-writable. Sets composition order; equal orders use entity ID.
enabledfield#
enabled: booleanCaller-writable. Enables this viewport.
Values#
ActiveCameravariable#
const ActiveCamera: tecs.ecs.ComponentSelects 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.ComponentRequests 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 DirtyTileChunkRequests 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: integerRequests 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 PivotAnchors 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.ComponentMarks an entity as contributing geometry to the two-dimensional scene.
Renderable3Dvariable#
const Renderable3DMarks 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.ComponentMarks an entity as one glyph tecs.gfx.text placed for a Text.
TILE_CHUNK_SIZEvariable#
const TILE_CHUNK_SIZE: integerThe 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.