Skip to content

Components

SortingGroup

Draws the sprites, shapes, lines, trails, sprite shapes, polygons, meshes and words under this node as one unit at one layer and depth, so nothing slips between the members of a stack. Tiles and particles still sort for themselves.

On this page

Add it

+ Add node → Sorting Group creates a node with it already on. Already have a node for it? Add component → SortingGroupComponent.

From a script

A script on the same node writes these fields by name. SortingGroupComponent is the name to pass.

rgs
set_number("SortingGroupComponent", "depth", 0.0);
set_flag("SortingGroupComponent", "enabled", true);

Fields

FieldScript nameKindDefaultWhat it does
Sort Layerlayernumber0Where the whole group sorts against the room; lower draws first.
Depthdepthnumber, step 0.10Place within the layer; higher draws later.
EnabledenabledcheckboxonWhether the group is grouping right now.