Skip to content

Components

Components are data attached to entities. In Estella, you define components in code and attach them to entities in the scene editor.

Builtin Components

Builtin components are always available in the editor. They are backed by the C++ backend.

Transform

Position, rotation, and scale of an entity.

PropertyTypeDescription
positionVec3Local position { x, y, z }
rotationQuatQuaternion { w, x, y, z }
scaleVec3Scale factor { x, y, z }
worldPositionVec3Computed world position (read-only)
worldRotationQuatComputed world rotation (read-only)
worldScaleVec3Computed world scale (read-only)

Sprite

2D sprite rendering. Requires Transform to be visible. See Sprite guide for full details.

Camera

View settings. At least one active camera is required to see anything. The editor’s default scene includes one.

PropertyTypeDescription
projectionTypeProjectionTypeOrthographic — use ProjectionType.Perspective (0) or ProjectionType.Orthographic (1)
fovnumberField of view in degrees (perspective only)
orthoSizenumberHalf-height in world units (orthographic only). Default: 540
nearPlanenumberNear clipping plane
farPlanenumberFar clipping plane
isActivebooleanWhether this camera is used for rendering
aspectRationumberCamera aspect ratio
prioritynumberRender order — lower priority renders first, higher renders on top
viewportXnumberViewport left edge (0–1). Default: 0
viewportYnumberViewport bottom edge (0–1). Default: 0
viewportWnumberViewport width (0–1). Default: 1
viewportHnumberViewport height (0–1). Default: 1
clearFlagsClearFlagsClearFlags.ColorAndDepth (3) — None (0), ColorOnly (1), DepthOnly (2), ColorAndDepth (3)
showFrustumbooleanDraw the camera frustum wireframe in the editor

Canvas

Display settings for the rendering surface.

PropertyTypeDescription
designResolutionVec2Design resolution { x, y }
pixelsPerUnitnumberPixels per world unit
scaleModeScaleModeScaleMode.FixedHeight (1) — FixedWidth (0), FixedHeight (1), Expand (2), Shrink (3), Match (4)
matchWidthOrHeightnumberBalance between width/height matching
backgroundColorColorClear color RGBA

Velocity

Movement velocity.

PropertyTypeDescription
linearVec3Linear velocity
angularVec3Angular velocity

Parent / Children

Entity hierarchy for scene graphs.

ComponentPropertyTypeDescription
ParententityEntityParent entity ID
ChildrenentitiesEntity[]List of child entity IDs

SpineAnimation

Spine skeletal animation playback. Requires Transform. See Spine Animation guide for full details.

BitmapText

GPU-rendered text using pre-baked bitmap font atlases (BMFont format). Requires Transform. See Bitmap Text guide for full details.

PropertyTypeDescription
textstringText content
colorColorTint color RGBA
fontSizenumberScale factor relative to the font’s native size
alignnumberHorizontal alignment: 0=Left, 1=Center, 2=Right
spacingnumberExtra spacing between characters
layernumberRender layer
fontnumberFont handle from assets.loadBitmapFont()
enabledbooleanWhether this text is rendered

Text

UI text rendering. Works with UIRect and Sprite to display text. See Text & Image for full details.

PropertyTypeDescription
contentstringText content
fontFamilystringFont family
fontSizenumberFont size in pixels
colorColorText color RGBA
alignTextAlignHorizontal alignment
verticalAlignTextVerticalAlignVertical alignment
wordWrapbooleanEnable word wrapping
overflowTextOverflowOverflow behavior: Visible (0), Clip (1), Ellipsis (2)
lineHeightnumberLine height multiplier

UIRect

UI layout rectangle. Defines anchored layout for UI elements.

PropertyTypeDescription
anchorMinVec2Lower-left anchor (0–1)
anchorMaxVec2Upper-right anchor (0–1)
offsetMinVec2Pixel offset from anchorMin
offsetMaxVec2Pixel offset from anchorMax
sizeVec2Width and height
pivotVec2Pivot point for rotation

UIMask

Clips child entities to the parent’s UIRect bounds. Requires UIRect and Transform on the same entity. See Masking & SafeArea for details.

PropertyTypeDefaultDescription
enabledbooleantrueWhether clipping is active
modenumber0Masking technique: 0=Scissor, 1=Stencil

Interactable

Marks a UI element as interactive (receives pointer events). Requires UIRect.

PropertyTypeDefaultDescription
enabledbooleantrueWhether interaction is active
blockRaycastbooleantrueBlock raycast from reaching entities behind
raycastTargetbooleantrueWhether this entity is a valid raycast hit target

Button

Button behavior for UI elements. Requires Interactable and UIRect.

PropertyTypeDefaultDescription
statenumber0 (Normal)0=Normal, 1=Hovered, 2=Pressed, 3=Disabled
transitionButtonTransition | nullnullColor transition for each state

Name

A string identifier for the entity. Useful for finding entities by name at runtime.

PropertyTypeDefaultDescription
valuestring''Entity name

Physics

Physics components require the PhysicsPlugin. See Physics guide for setup and usage.

RigidBody

Physics body attached to an entity. Requires Transform.

PropertyTypeDefaultDescription
bodyTypenumber2 (Dynamic)0=Static, 1=Kinematic, 2=Dynamic
gravityScalenumber1.0Gravity multiplier
linearDampingnumber0.0Linear velocity damping
angularDampingnumber0.0Angular velocity damping
fixedRotationbooleanfalseLock rotation
bulletbooleanfalseContinuous collision detection for fast objects
enabledbooleantrueEnable physics body

BoxCollider

PropertyTypeDefaultDescription
halfExtentsVec2{x: 0.5, y: 0.5}Half size in meters
offsetVec2{x: 0, y: 0}Local offset
densitynumber1.0Mass density
frictionnumber0.3Surface friction
restitutionnumber0.0Bounciness
isSensorbooleanfalseTrigger-only (no physical response)
enabledbooleantrueEnable this collider

CircleCollider

PropertyTypeDefaultDescription
radiusnumber0.5Circle radius in meters
offsetVec2{x: 0, y: 0}Local offset
densitynumber1.0Mass density
frictionnumber0.3Surface friction
restitutionnumber0.0Bounciness
isSensorbooleanfalseTrigger-only (no physical response)
enabledbooleantrueEnable this collider

CapsuleCollider

PropertyTypeDefaultDescription
radiusnumber0.25Capsule radius
halfHeightnumber0.5Half height of the capsule body
offsetVec2{x: 0, y: 0}Local offset
densitynumber1.0Mass density
frictionnumber0.3Surface friction
restitutionnumber0.0Bounciness
isSensorbooleanfalseTrigger-only (no physical response)
enabledbooleantrueEnable this collider

Component Enabled Toggle

Components that have an enabled property in their definition display a checkbox in the Inspector header. Unchecking it sets enabled to false, which the corresponding system can use to skip processing.

This applies to builtin components like Interactable, UIMask, and RigidBody, as well as any custom component that includes an enabled field:

const MyComponent = defineComponent('MyComponent', {
enabled: true,
speed: 100,
});

When disabled, the component header in the Inspector is visually dimmed.

Custom Components

defineComponent

Define a data component in code. After saving, it appears in the editor’s “Add Component” menu.

import { defineComponent } from 'esengine';
export const Health = defineComponent('Health', {
current: 100,
max: 100
});

Then in the editor: select an entity → Add Component → Health → set values in the inspector.

Systems query entities with this component:

import { defineSystem, addSystem, Query } from 'esengine';
import { Health } from './components/Health';
addSystem(defineSystem(
[Query(Health)],
(query) => {
for (const [entity, health] of query) {
if (health.current <= 0) {
// handle death
}
}
}
));

defineTag

A tag component has no data — it’s used purely for filtering entities.

import { defineTag } from 'esengine';
export const Player = defineTag('Player');
export const Enemy = defineTag('Enemy');

Attach Player to an entity in the editor, then query it:

addSystem(defineSystem(
[Query(Transform, Player)],
(query) => {
for (const [entity, transform] of query) {
// only processes entities with the Player tag
}
}
));

Runtime Entity Spawning

For entities created at runtime (bullets, particles, effects), use Commands:

import { addStartupSystem, defineSystem, Commands, Sprite, Transform } from 'esengine';
addStartupSystem(defineSystem(
[Commands()],
(cmds) => {
const entity = cmds.spawn()
.insert(Sprite, { size: { x: 10, y: 10 } })
.insert(Transform, { position: { x: 0, y: 0, z: 0 } })
.id();
}
));

Removing Components at Runtime

cmds.entity(entity).remove(Velocity);

Next Steps