Skip to reading
GDScript Programming & Godot

Set2DLayerVisible()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page

Show / Hide 2D Layer

Show or hide a named 2D layer.

Source table from Set2DLayerVisible(), page 152
Option key / fieldMeaning and inputDefault
Room (empty = current) sceneIdChoose a scene ID. May be blank.Blank
2D Layer ID layerIdText.Blank
Visible visibleExplicit visible/hidden state.true

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await Set2DLayerVisible({"sceneId": "lab", "layerId": "", "visible": true})

In use. Hide a foreground curtain layer after it opens. Select the layer ID used by the room, not the ID of an image asset imported into the project.

Set2DEntityDepth()#

Set 2D Entity Depth

Change an entity's sorting depth in the 2D/hybrid scene.

Source table from Set2DLayerVisible(), page 152
Option key / fieldMeaning and inputDefault
Room (empty = current) sceneIdChoose a scene ID. May be blank.Blank
2D Character / Object entityIdChoose an entity in the selected scene.Blank
Drawing Depth depthWhole number.100

Timing. Waits for the runtime routine to return; no further completion wait is promised by this schema.

Code example
await Set2DEntityDepth({"sceneId": "lab", "entityId": "archive_door", "depth": 100})

In use. Adjust a foreground prop's depth so it appears in front of the intended sprites. Depth is drawing order; it is not a height coordinate or a collision box dimension.

Page 152 of 378Permalink
Go to page