DecayKnowledgebase
generated reference

Sindri Decay API

Executable truth from engine 0.1.0 at 909aca81368b. This index is generated; do not edit signatures here.

Host types and namespaces

  • Action8 membersWhat the player means rather than what they pressed: the input actions the scene declares, such as "jump" or "move", each bound to keys, buttons and sticks that can be changed while the game runs. A binding is written as text: "key.Space", two sources for an axis ("key.A/key.D"), or four for a direction ("key.W/key.S/key.A/key.D"). A name the scene does not declare is an error.
  • Aim7 membersWhich block in a 3D block world the mouse or finger is pointing at, for building and digging games.
  • Animation8 membersPlaying an object's animations, such as walk or jump, set up for it in the scene.
  • Audio9 membersPlaying sound effects and music. Every sound goes through a bus — "effects", "music", or any other name — and every bus through "master", so a settings screen can turn each down.
  • Camera21 membersThe game's camera: projection sizing, 3D orbit with obstruction pull-in, and engine-owned 2D follow, confinement and shake.
  • CharacterCarry3d3 membersVerified solved platform carry, already included in total character translation. A platform rotation moves the probe origin along a straight swept chord; it does not rotate the actor.
  • CharacterCollision3d3 membersOne historical movement-phase collision; internal stair and snap probes are not events.
  • CharacterMotion2d18 membersA copied result of scene-owned 2D character movement. Gameplay reads support and collision flags to choose its own gravity, jump and recovery policy. This is historical movement, not a live solver contact or a pending request.
  • CharacterMotion3d7 membersCopied historical scene-owned 3D character result. Gameplay chooses gravity, jumping and recovery. This is not a live contact or pending request.
  • CharacterMovement3d4 membersCopied raw Rapier movement phase. Backend flags are not classified walkable support and must not alone authorize snapping. No independent step/snap displacement or iteration-limit status is available.
  • ColorTween0 membersA managed Color tween; read with Tween.color_value.
  • Contact2d8 membersA copied solid solver contact from the last fixed step, relative to the queried body. Sensors are excluded. Multiple points/pieces may name one entity. Sleeping contacts retain support geometry and report zero new impulses/force. Editing a snapshot does not change physics.
  • Effects6 membersParticle effects, such as sparks and explosions. The particles are only drawn; they are not objects and nothing can touch them.
  • Entity10 membersAn object in the game, such as a player, an enemy or a button. Scripts get these from calls like World.find and can store them, compare them and change their transform, sprite or shape.
  • Game2 membersNumbers stored under names that every script can read and write, such as a score. Declaring them with state is safer, because a misspelt name then becomes an error.
  • Gamepad8 membersGame controllers. Each player gets a number from 1 to 8 when they press a button on their controller; 0 means any controller.
  • Gesture11 membersWhat the player did with the mouse or a finger: a tap, a hold, a drag or a pinch. Works the same for both.
  • Graphics2 membersHow richly the game is drawn: how far cameras see and how far and sharp shadows are. A settings menu offers it.
  • Grid19 membersGrids of tiles, flat or stacked in layers like building blocks: what each cell holds, where objects stand on them, and paths across them.
  • Input11 membersEvery way the player reaches the game, in one place. Start with Input.Action, which works the same whatever the player holds; Input.Pointer, Input.Stick and Input.Gesture for mouse and touch; Input.Keyboard, Input.Touch and Input.Gamepad for one device read directly. The calls directly on Input are the keyboard, kept for older scripts: prefer Input.Keyboard.
  • Keyboard4 membersThe keyboard, as Input.Keyboard. Keys are named by position, such as "W", "ArrowLeft" or "Space", so controls work on any keyboard layout. For controls that also work on a controller or a touch screen, use Input.Action.
  • Light6 membersA directional, point or spot 3D light. Writes validate the whole candidate before changing the payload. Missing components and invalid values are errors. Rotation/position come from the entity transform.
  • Light2d8 membersA light in a 2D scene: it brightens sprites, tiles and shapes near it when the scene's environment turns 2D lighting on, in every direction or, with a cone_angle below 360, in a beam. Switch one off with its object's set_active.
  • Lighting2 membersAsks the scene's 2D lighting about places in the world. Requires a scene whose environment has 2D lighting on, and fails otherwise. Every light and occluder in the world counts, wherever the camera is. A point is lit by a light when no occluder edge crosses the line between it and the light's centre, so a soft penumbra is a hard edge here, and a light that does not cast shadows shines through occluders.
  • NumberTween0 membersA managed number tween; read with Tween.number_value.
  • Particles7 membersA particle emitter on an object: smoke, sparks, embers. It throws rate particles a second while it plays. An object's own emitter is particles; another, named one is particles("surge").
  • Physics48 members2D physics: moving objects with speed and pushes, and finding out what this script's object bumped into.
  • Physics3d24 membersIndependent 3D physics controls, indexed queries and copied last-step events. Requires a 3D physics host. Controls require an active body. Before synchronization, valid authored 3D bodies with nonempty primitive colliders or convex-model references accept ordered setters/impulses. Convex asset geometry, scaled hull mass and pending controls validate at scene synchronization; replay uses actual compound mass. Unconsumed requests expire after successful synchronization. Authored motion fields are unchanged, so structural rebuilds restore authored settings.
  • Pointer17 membersThe mouse, or a finger on a touch screen, handled the same way so one game works on both.
  • Profile0 membersA profile: a data file of settings shared across a project. Chosen in the editor for a script's @export field and read with Profiles.
  • Profiles9 membersReading settings from a profile, a data file shared across a project, such as a weapon's damage and fire rate.
  • Quat4 membersA copied quaternion value, with x/y/z/w components. Build with Quat(x: 0.0, y: 0.0, z: 0.0, w: 1.0), or copy transform.rotation. Change a local var's components, then assign the whole value; no quaternion arithmetic or interpolation methods are provided.
  • Random5 membersRandom numbers. The same seed always gives the same numbers, so a run can be replayed.
  • RayHit2d4 membersA copied 2D ray hit snapshot. Null means no hit. Holds entity, world-space point and normal, and distance in world units. Copying or editing a snapshot never changes physics.
  • RayHit3d4 membersCopied closest 3D ray/shape-cast hit, optional where no hit exists. World-space point/normal and world-unit distance; editing fields never changes simulation geometry.
  • Save11 membersSaving progress between play sessions: numbers, text and true/false values stored under names, such as a best score.
  • Scene3 membersScenes are a game's separate places or screens, such as a menu, a level or a shop. This asks which one is playing and moves to another.
  • SceneBloom4 membersThe glow that spreads from bright light, such as a lamp or an emissive model.
  • SceneEnvironment6 membersThe existing authored scene environment on an entity. Changes affect the next extracted frame without restarting. Missing components and stale entities are runtime errors; writes validate the full payload atomically. Fog, the color grade and bloom are reached through fog, post_process and bloom.
  • SceneFog7 membersFog over the 3D world, from the camera outward and thickest low down. A section the scene never authored starts from its defaults, and a write keeps every other field. Refused values leave the payload as it was.
  • ScenePostProcess4 membersThe grade applied to the lit world before the interface is drawn over it.
  • Sequence8 membersPlaying an object's sequences: choreography set up for it in the scene's Timeline, such as a title sliding in or a door opening, with named cues along the way.
  • ShaderParams4 membersThe four numbers a sprite's shader reads. What each one means is up to the shader.
  • Shape9 membersA shape drawn in the game world, such as a circle, polygon or ring, with an inside color and an outline.
  • Sight2d3 membersA viewer in a 2D scene: everything it cannot see in a straight line, past the edges of occluders, is dimmed when the scene's environment turns 2D lighting on. Lights are not changed; only what is out of sight.
  • Sprite5 membersA 2D image drawn in the game world, and how it is colored.
  • Stick7 membersA virtual joystick for touch screens: wherever a thumb lands becomes the centre, and dragging from there steers. A thumb that lands on an on-screen button presses the button instead, so the stick waits for one that lands off them.
  • Time2 membersTime in the game. A game runs as a series of frames, many times a second.
  • Touch3 membersEvery finger on a touch screen, numbered from 0, for games that need more than one finger.
  • Transform15 membersWhere an object is, how it is turned and how big it is. For an object attached to another, these are measured from that parent.
  • Tween21 membersCreates automatically playing gameplay tweens owned by the calling script. Copies alias playback state. Advance occurs before the owner's subsequent updates using script delta. No automatic property binding. Curves: linear, ease, ease-in, ease-out, ease-in-out. Finite endpoints and finite non-negative duration are required; zero duration completes immediately. Maximum 8192 retained handles per runner; dispose unused handles.
  • TweenHandle0 membersThe common handle accepted by playback controls; only factories construct one.
  • Ui30 membersThe interface drawn over the game: changing text and bars, and checking buttons and sliders.
  • UiImage2 membersAn image in the interface drawn over the game, such as a health bar or an icon, rather than in the game world.
  • Vec2Tween0 membersA managed Vec2 tween; read with Tween.vec2_value.
  • Vec3Tween0 membersA managed Vec3 tween; read with Tween.vec3_value.
  • Viewport1 membersThe area of the screen the game is drawn in.
  • World17 membersFinding, creating and removing the objects in a game. Every object in a scene (a player, an enemy, a button) is an entity.
  • WorldText4 membersWords placed in the game world, such as a damage number or a name over a character. Change the words with Ui.set_text and Ui.set_number, as for interface text.
  • this11 membersWhat a script can reach on the object it is attached to, beyond its own fields.

Globals

  • Action: ActionWhat the player means rather than what they pressed: the input actions the scene declares, such as "jump" or "move", each bound to keys, buttons and sticks that can be changed while the game runs. A binding is written as text: "key.Space", two sources for an axis ("key.A/key.D"), or four for a direction ("key.W/key.S/key.A/key.D"). A name the scene does not declare is an error.
  • Aim: AimWhich block in a 3D block world the mouse or finger is pointing at, for building and digging games.
  • Animation: AnimationPlaying an object's animations, such as walk or jump, set up for it in the scene.
  • Audio: AudioPlaying sound effects and music. Every sound goes through a bus — "effects", "music", or any other name — and every bus through "master", so a settings screen can turn each down.
  • Camera: CameraThe game's camera: projection sizing, 3D orbit with obstruction pull-in, and engine-owned 2D follow, confinement and shake.
  • Effects: EffectsParticle effects, such as sparks and explosions. The particles are only drawn; they are not objects and nothing can touch them.
  • Game: GameNumbers stored under names that every script can read and write, such as a score. Declaring them with state is safer, because a misspelt name then becomes an error.
  • Gamepad: GamepadGame controllers. Each player gets a number from 1 to 8 when they press a button on their controller; 0 means any controller.
  • Gesture: GestureWhat the player did with the mouse or a finger: a tap, a hold, a drag or a pinch. Works the same for both.
  • Graphics: GraphicsHow richly the game is drawn: how far cameras see and how far and sharp shadows are. A settings menu offers it.
  • Grid: GridGrids of tiles, flat or stacked in layers like building blocks: what each cell holds, where objects stand on them, and paths across them.
  • Input: InputEvery way the player reaches the game, in one place. Start with Input.Action, which works the same whatever the player holds; Input.Pointer, Input.Stick and Input.Gesture for mouse and touch; Input.Keyboard, Input.Touch and Input.Gamepad for one device read directly. The calls directly on Input are the keyboard, kept for older scripts: prefer Input.Keyboard.
  • Lighting: LightingAsks the scene's 2D lighting about places in the world. Requires a scene whose environment has 2D lighting on, and fails otherwise. Every light and occluder in the world counts, wherever the camera is. A point is lit by a light when no occluder edge crosses the line between it and the light's centre, so a soft penumbra is a hard edge here, and a light that does not cast shadows shines through occluders.
  • PI: numberThe number π (3.14159…): half a full turn when measuring angles in radians.
  • Physics: Physics2D physics: moving objects with speed and pushes, and finding out what this script's object bumped into.
  • Physics3d: Physics3dIndependent 3D physics controls, indexed queries and copied last-step events. Requires a 3D physics host. Controls require an active body. Before synchronization, valid authored 3D bodies with nonempty primitive colliders or convex-model references accept ordered setters/impulses. Convex asset geometry, scaled hull mass and pending controls validate at scene synchronization; replay uses actual compound mass. Unconsumed requests expire after successful synchronization. Authored motion fields are unchanged, so structural rebuilds restore authored settings.
  • Pointer: PointerThe mouse, or a finger on a touch screen, handled the same way so one game works on both.
  • Profiles: ProfilesReading settings from a profile, a data file shared across a project, such as a weapon's damage and fire rate.
  • Random: RandomRandom numbers. The same seed always gives the same numbers, so a run can be replayed.
  • Save: SaveSaving progress between play sessions: numbers, text and true/false values stored under names, such as a best score.
  • Scene: SceneScenes are a game's separate places or screens, such as a menu, a level or a shop. This asks which one is playing and moves to another.
  • Sequence: SequencePlaying an object's sequences: choreography set up for it in the scene's Timeline, such as a title sliding in or a door opening, with named cues along the way.
  • Stick: StickA virtual joystick for touch screens: wherever a thumb lands becomes the centre, and dragging from there steers. A thumb that lands on an on-screen button presses the button instead, so the stick waits for one that lands off them.
  • TAU: numberThe number τ (6.28318…), which is 2π: one full turn when measuring angles in radians.
  • Time: TimeTime in the game. A game runs as a series of frames, many times a second.
  • Touch: TouchEvery finger on a touch screen, numbered from 0, for games that need more than one finger.
  • Tween: TweenCreates automatically playing gameplay tweens owned by the calling script. Copies alias playback state. Advance occurs before the owner's subsequent updates using script delta. No automatic property binding. Curves: linear, ease, ease-in, ease-out, ease-in-out. Finite endpoints and finite non-negative duration are required; zero duration completes immediately. Maximum 8192 retained handles per runner; dispose unused handles.
  • Ui: UiThe interface drawn over the game: changing text and bars, and checking buttons and sliders.
  • Viewport: ViewportThe area of the screen the game is drawn in.
  • World: WorldFinding, creating and removing the objects in a game. Every object in a scene (a player, an enemy, a button) is an entity.
  • abs(value: number) -> numberThe number without its minus sign: abs(-3.0) is 3. Useful for distances and differences where only the size matters.
  • atan2(y: number, x: number) -> numberThe angle pointing from the origin towards the point (x, y), in radians. Use it to turn something to face a direction: atan2(dy, dx).
  • ceil(value: number) -> numberRounds up to a whole number: ceil(2.1) is 3.
  • clamp(value: number, low: number, high: number) -> numberKeeps a number between a lowest and a highest value: clamp(hp, 0.0, 100.0) never goes below 0 or above 100.
  • cos(angle: number) -> numberThe cosine of an angle in radians. With sin, turns an angle into a direction: Vec2(cos(a), sin(a)).
  • exp(value: number) -> numberThe number e raised to a power. Mostly used for smooth movement that looks the same at any frame rate: 1.0 - exp(-speed * dt).
  • floor(value: number) -> numberRounds down to a whole number: floor(2.9) is 2.
  • lerp(a: number, b: number, t: number) -> numberBlends between two numbers: t of 0 gives a, 1 gives b, and 0.5 gives halfway. Used for smooth movement and fades.
  • max(a: number, b: number) -> numberThe larger of two numbers.
  • min(a: number, b: number) -> numberThe smaller of two numbers.
  • print(value: unknown) -> unitWrites a message to the log, for checking what a script is doing. Accepts any value; combine text and values with +: print("hp " + hp).
  • round(value: number) -> numberRounds to the nearest whole number: round(2.5) is 3 and round(-2.5) is -3.
  • sign(value: number) -> numberWhether a number is negative, zero or positive, as -1, 0 or 1. Handy for "which way is this moving?".
  • sin(angle: number) -> numberThe sine of an angle in radians. Good for bobbing and waving motion: sin(Time.elapsed).
  • sqrt(value: number) -> numberThe square root of a number.
Source
docs/generated/decay-api.json
Schema
v1
Engine version
0.1.0
Source commit
909aca81368b