Describe Sort with parent for children (#232)
A child's Z used to count against the whole scene. The new switch keeps it local to the parent, and the pages need to say when and how. - Scene editing: new paragraph "Sort with parent". It covers behind and in front of the parent, chains, the defaults for new and saved objects and the parents where it has no effect. - Animations: the Z row points to Sort with parent. - Development: check total 1398. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent
c24de91aca
commit
604a2e22b3
3 files changed
+17
-2
No files matched your search
+3
-1
@@ -15,7 +15,9 @@ A placed root or object offers its position as the first rows: **X**, **Y** and
|
||||
draw order (higher is on top), and the order is sorted again on every render, so a keyed *Z* moves
|
||||
the object behind or in front of others while the animation plays — a weapon that swings up can
|
||||
pass behind its character. Blended values between two keys count as they are: at *Z* 4.5 the
|
||||
object is above everything on 4 and below everything on 5.
|
||||
object is above everything on 4 and below everything on 5. A child with *Sort with parent* on
|
||||
moves only against its parent and siblings, not against the whole scene (see
|
||||
[Scene editing](Scene-editing), #232).
|
||||
|
||||
Besides the schema's own properties, a row can key what an object **declares** (#104): a
|
||||
**behavior's variables** — pick the behavior (it sits below its owner in the object list) and its
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ npm run build # writes dist/ and regenerates index.html
|
||||
php tools/make-user.php <name> <password> [admin|user] # an account; every tool signs in (see Accounts)
|
||||
php tests/php/accounts.test.php # the API's account rules, no server needed (CI's gate job)
|
||||
php tests/php/snapshots.test.php # the snapshot store (#231), the same way
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1397 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1398 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
|
||||
./e2e.sh start [GM_STEPS] # the same run detached, see below
|
||||
./e2e.sh status # live progress, or the last run's result
|
||||
|
||||
+13
@@ -66,6 +66,19 @@ of a tilemap are sorted in one by one, each at the map's `z` plus its own (see [
|
||||
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).
|
||||
|
||||
**Sort with parent.** A child's `z` adds up with its parent's, and on its own the child is sorted
|
||||
against the whole scene: at `z` -1 under a figure on 0 it would fall behind *everything* on 0.
|
||||
Sprites, texts and particle sources therefore have the switch **Sort with parent**, right under
|
||||
*Z* in the inspector (#232). With it on, the child is drawn in its parent's place: against the rest
|
||||
of the scene only the parent counts, with its `z` and, on a `z` sorted by Y, its feet. The child's
|
||||
own `z` then only orders it against the parent and their siblings: below 0 behind the parent, 0 and
|
||||
above in front of it, ties in hierarchy order. It chains, so a grandchild with the switch on sorts
|
||||
with the topmost object of the chain. A new asset starts with the switch on; an asset stored before
|
||||
it had it reads as off, so older projects draw as they did. It is an ordinary property: set on the
|
||||
asset, overridden per object. A parent that is not drawn itself (container, behavior, camera,
|
||||
collider) or is a tilemap has no single place to share, so there the switch does nothing. The rule
|
||||
lives in `drawSlots` (`src/viewport/drawOrder.ts`), which the scene view, the game and picking share.
|
||||
|
||||
**Transform.** Sprites, texts, colliders and containers carry four more rows next to their
|
||||
position: **Scale** (one factor, default 1), **Rotation** (degrees, positive turns clockwise on
|
||||
screen), **Mirror X** and **Mirror Y**. They are ordinary properties — set on the asset, overridden
|
||||
|
||||
Reference in new issue
Block a user