Reference: components, assets, script modules and value types
Every component, asset type and script module in the Balaur game engine.
На этой странице
Every component, asset type and script module in the engine.
- A component gives a node a capability:
sprite,body3d,bone2d. - An asset type is a resource a component names:
mesh,tileset. - A script module is a set of functions a script calls:
http,physics3d. - A value type is a value a script does maths with:
balaur::Vec2,balaur::Quat.
Components
2D
| component | properties | what it gives a node |
|---|---|---|
body2d |
23 | A 2D rigid body simulated by rapier in the xy plane. |
bone2d |
4 | Makes the node a 2D bone. |
boolean2d |
17 | Draws the node as its 2D children combined by operation, holes and all. |
camera2d |
55 | The orthographic camera a flat scene is drawn from. |
character2d |
18 | A 2D character controller. |
collider2d |
66 | The node's 2D collision shape, chosen by kind. |
follow2d |
12 | Pulls the node's body2d towards the pose of target every fixed step. |
joint2d |
28 | Joins this node's body to connected_body. |
light2d |
9 | A 2D light at the node's position. |
modifier2d |
16 | Poses 2D bones toward target after the clip runs. |
multimesh2d |
14 | Godot's MultiMeshInstance2D. |
occluder2d |
2 | The outline the node blocks 2D light with. |
particles2d |
27 | A visual-only 2D emitter at the node. |
polygon |
15 | A filled, textured 2D polygon from the mesh asset's points and triangles. |
screen_notifier2d |
2 | A box that announces screen_enter as it comes on screen and screen_exit as it leaves. |
shape2d |
34 | A 2D primitive at the node, tinted by color and drawn with texture. |
softbody2d |
85 | A deformable 2D body. |
sprite |
27 | A textured 2D quad at the node, sized by pixels_per_unit. |
text2d |
50 | A block of text drawn in the 2D pass, pixels_per_unit font pixels per world unit. |
tile_collision |
26 | Collision for the node's tilemap cells. |
tilemap |
18 | A grid of tiles from one tileset asset, centred on the node. |
touch_button |
9 | An on-screen button that presses an action while a finger is on it. |
touch_stick |
11 | An on-screen stick that drives action_x and action_y from -1..1 while a thumb drags it. |
transform |
4 | The node's position, rotation_euler, scale and skew in its parent's space. |
3D
| component | properties | what it gives a node |
|---|---|---|
body3d |
25 | A 3D rigid body simulated by rapier. |
bone3d |
4 | Makes the node a 3D bone. |
boolean3d |
17 | Draws the node as its children combined by operation. |
camera3d |
61 | The camera the scene is drawn from. |
character3d |
18 | A 3D character controller. |
collider3d |
64 | The node's 3D collision shape, chosen by kind. |
environment |
42 | The scene's atmosphere. |
follow3d |
12 | Pulls the node's body3d towards the pose of target every fixed step. |
joint3d |
29 | Joins this node's body to connected_body. |
light3d |
9 | A 3D light placed and aimed by the node. |
mesh |
18 | 3D geometry from the mesh asset in source, drawn at the node. |
modifier3d |
16 | Poses bone3d nodes toward target after the clip runs. |
multimesh3d |
17 | Godot's MultiMeshInstance3D. |
particles3d |
31 | A visual-only 3D emitter at the node, drawn as instances of one quad. |
reflection_probe |
9 | A box the room around it was captured inside. |
shape3d |
26 | A 3D primitive at the node, tinted by color and drawn with texture. |
softbody3d |
98 | A deformable 3D body. |
text3d |
56 | A block of text drawn in the 3D pass on a quad, pixels_per_unit font pixels per world unit. |
vehicle3d |
4 | Makes the node's body3d a raycast vehicle chassis. |
wheel3d |
11 | One wheel of the vehicle3d above it. |
Physics
| component | properties | what it gives a node |
|---|---|---|
ragdoll |
2 | Drives a rig's bones from the bodies that physics2d.ragdoll or physics3d.ragdoll built. |
Rendering
| component | properties | what it gives a node |
|---|---|---|
material |
1 | source is the material asset this node and everything under it draw with. |
Animation
| component | properties | what it gives a node |
|---|---|---|
animation |
4 | Plays animation clips on the node. |
state_machine |
4 | Runs the state_machine asset in machine over the player node's clips. |
Audio
| component | properties | what it gives a node |
|---|---|---|
listener |
4 | The point positional sounds are heard from. |
sound |
37 | A sound on the node. |
UI
| component | properties | what it gives a node |
|---|---|---|
widget |
223 | A HUD element drawn every frame. |
Other
| component | properties | what it gives a node |
|---|---|---|
bindings |
1 | Reactions the node runs from a table. |
meta |
0 | Named values filed on the node, like Godot's set_meta. |
states |
2 | Named looks for the node. |
timer |
5 | Counts wait_time seconds down and emits timeout from the node. |
Asset types
| type | files | used by |
|---|---|---|
animation_library |
animations/ |
animation.library |
bone_map |
animations/ |
— |
heightfield |
heightfields/ |
collider2d.heightfield, collider3d.heightfield |
material |
materials/ |
boolean2d.material, boolean3d.material, material.source, mesh.material, multimesh2d.material, multimesh3d.material, particles2d.material, particles3d.material, polygon.material, shape2d.material, shape3d.material, sprite.material, text2d.material, text3d.material, tilemap.material |
mesh |
models/ |
collider2d.mesh, collider3d.mesh, mesh.source, occluder2d.mesh, polygon.mesh, shape2d.mesh, softbody2d.collision_mesh, softbody2d.mesh, softbody3d.collision_mesh, softbody3d.mesh |
multimesh |
multimeshes/ |
multimesh2d.source, multimesh3d.source |
path2d |
paths/ |
— |
path3d |
paths/ |
— |
skeleton_profile |
animations/ |
— |
sprite_sheet |
sheets/ |
particles2d.sheet, sprite.sheet |
state_machine |
animations/ |
state_machine.machine |
texture |
textures/ |
boolean2d.texture, boolean3d.texture, mesh.texture, multimesh2d.texture, multimesh3d.texture, particles2d.texture, particles3d.texture, polygon.texture, shape2d.normal_map, shape2d.texture, shape3d.texture, sprite.normal_map, sprite.texture |
tileset |
tilesets/ |
tilemap.tileset |
voxels |
voxels/ |
collider2d.voxels, collider3d.voxels |
widget_theme |
themes/ |
widget.theme |
Script modules
| module | functions | what it is for |
|---|---|---|
animation |
20 | Clip playback on a node's animation component: play, pause, seek and query. |
apple |
20 | Apple services beyond platform.*: Game Center identity, purchases, notifications. |
assets |
11 | Asset definitions by reference. |
audio |
23 | Sound playback. |
browser |
8 | The page a browser build runs in; off the web every query answers nil. |
debugger |
9 | Breakpoints, pausing a script and resuming it. |
encoding |
2 | Bytes to base64 text and back. |
engine |
28 | The running app. |
events |
6 | Named events between scripts. |
export |
6 | Exports the project being edited. |
fs |
9 | Files on disk, project-relative unless the path is absolute. |
gamend |
19 | The Gamend backend: session, REST API and realtime socket. |
geometry2d |
12 | Polygons on the plane as lists of [x, y] points in outline order. |
geometry3d |
6 | Mesh operations. |
hash |
2 | SHA-256 content hashes of files and strings. |
http |
2 | HTTP requests off the frame. |
import |
7 | Imports a .glb or .gltf model, an .aseprite sprite, or a .tmx or .ldtk level into the project being edited, with the importers balaur import runs. |
input |
53 | One frame of input. |
json |
2 | JSON text to and from script values. |
log |
7 | The info, warn and error levels a script writes at, and the buffer behind them. |
math |
24 | Deterministic float maths backed by pure-Rust libm. |
multiplayer |
14 | Host, join and play a rollback match. |
node |
56 | What every node has: name, path, transform, children, components and script. |
physics |
14 | What spans both physics worlds: pausing, sleeping, tuning and clearing. |
physics2d |
132 | The 2D rigid-body world. |
physics3d |
142 | The 3D rigid-body world. |
platform |
11 | Store services every platform shares: sign-in, achievements, leaderboards, cloud saves. |
project |
13 | The projects this machine has opened, the templates a new one starts from, and the folder picker the OS provides. |
random |
5 | The engine's one deterministic PCG32 stream. |
regex |
6 | Regular expressions, the regex-lite dialect: no look-around or back-references. |
release |
5 | Which build of the engine this is, what the channels are publishing, and replacing this install with another. |
render |
70 | What a frame is made of. |
replay |
17 | Records what a running game is fed and plays it back. |
rollback |
2 | Rollback netcode from a script's side. |
save |
6 | Save games: a table in, a table out, stored per user. |
scene |
22 | The node tree. |
script |
19 | Loads other scripts, inspects what they declare and calls into them. |
settings |
12 | Every setting the engine, its plugins and the game declare, by path. |
skeleton |
3 | Bones under a rig node: their rest pose and the order a skin numbers joints in. |
strings |
6 | Localization: one strings/<locale>.toml per language, keys to strings. |
task |
3 | Waiting inside an async handler. |
toml |
3 | TOML text to and from script tables, the format of scene files, asset definitions and component properties. |
ui |
73 | Immediate-mode UI redrawn from a script's draw_ui every frame. |
websocket |
4 | A long-lived socket for text or binary frames. |
window |
8 | The OS window and the display under it. |
Value types
| type | functions | constants |
|---|---|---|
balaur::Color |
5 | 0 |
balaur::IVec2 |
39 | 9 |
balaur::IVec3 |
38 | 11 |
balaur::Quat |
37 | 2 |
balaur::Transform2d |
15 | 3 |
balaur::Transform3d |
18 | 3 |
balaur::Vec2 |
77 | 12 |
balaur::Vec3 |
85 | 14 |
balaur::Vec4 |
71 | 16 |
Components
Every component a node can carry: what it gives the node, the properties a scene sets, and the functions a script calls on it.
Asset types
The content an asset-typed property names: a file in the project, or a definition written inline.
Script modules
What a script can call: every module, function and constant, read from a booted engine.
Value types
The maths types a script holds: vectors, a rotation, a transform and a colour. A name bound to one holds its own copy.