From cf0247a64a7455e6aef43363e4df2295b40c25e7 Mon Sep 17 00:00:00 2001 From: meleki Date: Sat, 3 Oct 2026 20:08:55 +0200 Subject: [PATCH] Get Z and Set Z nodes - Behaviors: both nodes in the lists of data and action nodes. - Scene editing: the z-order paragraph says a graph can read and change z while the game runs. Co-Authored-By: Claude Opus 5.5 --- Behaviors.md | 4 ++-- Scene-editing.md | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Behaviors.md b/Behaviors.md index 365a0e2..35e39d6 100644 --- a/Behaviors.md +++ b/Behaviors.md @@ -203,7 +203,7 @@ the inspector). the given object, nearer levels first, the order `Child by name` searches in), `Children` (the children of an object; with **recursive** every object below it, level by level) and `Objects of asset` (every instance of the chosen asset, spawned ones included), - `Variables`, `Properties` (every property row of the target's type, the transform rows `scale`, `rotation`, `mirrorX`, `mirrorY` included — how a graph turns a sprite), `Get position` (local and world), `Is enabled`, literals `Number`/`Text`/`Boolean`/`Texture`/`State machine`/`Sound`/`Scene`/`Animation`/`Asset`, `Texture size` (a texture's, frame's or pixel art's own size in pixels, 0 for none — wired into a sprite's `width`/`height`, a picture shows pixel for pixel), `Add/Subtract/Multiply/Divide`, + `Variables`, `Properties` (every property row of the target's type, the transform rows `scale`, `rotation`, `mirrorX`, `mirrorY` included — how a graph turns a sprite), `Get position` (local and world), `Get Z` (the object's own `z` and `world z`, summed up with its parents'), `Is enabled`, literals `Number`/`Text`/`Boolean`/`Texture`/`State machine`/`Sound`/`Scene`/`Animation`/`Asset`, `Texture size` (a texture's, frame's or pixel art's own size in pixels, 0 for none — wired into a sprite's `width`/`height`, a picture shows pixel for pixel), `Add/Subtract/Multiply/Divide`, `Min/Max/Abs/Sqrt/Clamp`, `Lerp` (from a to b as t runs from 0 to 1, t held in 0…1; the setting *Ease* bends the way: *Linear*, *In* starts slow, *Out* ends slow, *In-out* both, all quadratic, or *Curve*, which follows the [curve asset](Curves) picked in the *Curve* row and may overshoot b; @@ -232,7 +232,7 @@ the inspector). same for two numbers, and for a number against a typed text that is a number, like `130`), `And/Or/Not`, `Key is down`, `Key was pressed` and `Key was released` (true for the one frame in which the key went down or came up, the frame `On key down` and `On key up` fire in; a key that stays held is not pressed again), `Mouse position`, `Mouse button`, `Is hovered`, `Is touching`, `Layer of` (the collision layer of an object by name and number, see [Colliders](Colliders)), `Render layer of` (the render layer an object is drawn on, inherited or its own, see [Concepts](Concepts)), `Animation playing` (whether an animation runs on an object, its progress and time left) and `Animation length` (see [Animations](Animations)), `Get velocity`, `Joint position` (how far a hinge or a slider stands from how it was placed, see [Physics](Physics#joints)), `Current state` (name and id), `Is in state` (one boolean per state) · - actions `Move` (dx, dy, scale, dt — connect an event's dt for per-second movement; in the object's own axes, which a turned parent turns too; with *Collide with solids* it slides along what it hits, less friction, and outputs `blocked x/y`, `hit` and the contact `normal x/y`, see [Colliders](Colliders)), `Move toward` (x, y in world units, speed, dt: steps the object toward that point by at most speed times dt and stops exactly on it, also below a moved or turned parent; with *Collide with solids* it moves the way `Move` does; outputs `arrived`, the `distance` still left and `hit`. The way to walk an enemy to a spot, home or after the player), `Set position`, `Spawn` + actions `Move` (dx, dy, scale, dt — connect an event's dt for per-second movement; in the object's own axes, which a turned parent turns too; with *Collide with solids* it slides along what it hits, less friction, and outputs `blocked x/y`, `hit` and the contact `normal x/y`, see [Colliders](Colliders)), `Move toward` (x, y in world units, speed, dt: steps the object toward that point by at most speed times dt and stops exactly on it, also below a moved or turned parent; with *Collide with solids* it moves the way `Move` does; outputs `arrived`, the `distance` still left and `hit`. The way to walk an enemy to a spot, home or after the player), `Set position`, `Set Z` (the object's own `z`, which is its draw order: higher is in front from the next frame on, see [Scene editing](Scene-editing)), `Spawn` (asset input + x/y/z, optional parent → outputs the new object; the asset is picked on the node or arrives over an edge, from an `Asset` node, a variable or a list item. A pick saved while it was still a setting reads as that input's value, so older projects spawn as before; the same holds for the asset of `Is asset`), `Destroy` (removes the object with everything below it; with **keep children** on, only the object goes: its children move up to its parent (top level when it had none) and keep their place, rotation and size in the world, and the output `children` is the list of them, nearest level only. Its behaviors, its rigidbody and its joints go with it either way. In the editor run, children that are content of a placed container move up for the run only: their place belongs to the template, so the scene does not learn it), `Add joint` (ties an object to another while the game runs: the picked Joint asset is placed on *object* at x/y and connected to *connected*, the scene when nothing arrives; outputs the new joint, which `Destroy` lets go again, see [Physics](Physics#joints)), `Emit` (starts a particle source over, see *Particles*), `Play sound` / `Stop sound` (see [Sounds](Sounds): the asset says how loud and whether it loops, the node's `volume` multiplies that and its `loop` either leaves it alone or overrules it in either diff --git a/Scene-editing.md b/Scene-editing.md index 3fe7261..eff2e12 100644 --- a/Scene-editing.md +++ b/Scene-editing.md @@ -92,8 +92,10 @@ project. The Game tab and the running game are not affected. **Z-order is part of the position.** `position.z` is the draw order of a scene object: higher `z` is drawn on top; objects with equal `z` keep their hierarchy (tree) order. It is edited in the -inspector next to X/Y, undoable like any move, and applies in edit and play mode alike. The layers -of a tilemap are sorted in one by one, each at the map's `z` plus its own (see [Tilemaps](Tilemaps), #174). +inspector next to X/Y, undoable like any move, and applies in edit and play mode alike. In a +running game a graph reads it with `Get Z` and changes it with `Set Z` (see [Behaviors](Behaviors)). +The layers of a tilemap are sorted in one by one, each at the map's `z` plus its own (see +[Tilemaps](Tilemaps), #174). On the `z` of a layer sorted by Y, Y decides instead: whatever stands higher up is drawn first (see [Tilemaps](Tilemaps#sorting-by-y), #228).