Layer Functions and GameScene Preset Nodes
In ACTION GAME MAKER, when creating a scene, the following nodes are automatically generated: SceneLayer, DistantView, MiddleView, NearView, WallLayer, BaseLayer, PostEffectLayer, and UI.
This manual explains the roles of these nodes.
SceneLayer (Background Node)
SceneLayer is a renamed version of the Background node, which is a node specific to ACTION GAME MAKER. It is designed to work in combination with the Parallax2D node described below to achieve the movement of “draw layers” as found in other general-purpose tools.
In Godot Engine, the design philosophy dictates that drawing order is managed via the Z-coordinate parameter and group management is handled through the node hierarchy. Consequently, there is no node that corresponds to the general concept of a “layer.” (While nodes with “Layer” in their name exist, they are intended for special rendering processes.)
However, considering the nature of the visual scripting system, we determined that having a layer concept would be beneficial. Therefore, we have designed a dedicated node to implement drawing layer functionality.
DistantView, MiddleView, NearView, WallLayer, BaseLayer (Parallax2D Nodes)
Although these nodes have different names, they are all renamed versions of the same Godot node: Parallax2D.
Parallax2D is originally a node designed to implement parallax backgrounds, and its functionality can be utilized for that purpose. However, in ACTION GAME MAKER, it possesses another critical function: it recognizes Parallax2D nodes that are children of SceneLayer as drawing layers.
So, what can be achieved using layers?
Actions/Nodes Using Layers
MoveLayer
Changes the drawing order by moving an object to a child node of the specified layer (Parallax2D).
Show/Hide/Enable/Disable Layer
Modifies the behavior of the layer (Parallax2D) and its children corresponding to the specified number. The numbers are assigned in order from the top among the Parallax2D nodes that are children of SceneLayer. Therefore, in the default state, DistantView is Layer 1, and BaseLayer is Layer 5.
GenerateObject / FireBullet
If ObjectMountTarget is not specified, the object is generated as a child node of the layer (Parallax2D) to which the source object belongs. Note that if not specified, the object is generated as a sibling of the source object, not as its child.
Portal Node
A player who transitions using a portal will be generated as a child of the layer (Parallax2D) to which the portal belongs after the transition.
PostEffectLayer
This is a renamed version of the CanvasLayer node, which is specific to Godot. CanvasLayer is a node that realizes a special layer that is unaffected by the camera, meaning it can always be displayed on the screen.
PostEffectLayer is a node designed to implement screen effects that affect the entire scene, known as post-effects. It is necessary to apply screen effects using the Add/CancelSceneEffect actions to set or remove these effects.
UI
Similar to PostEffectLayer, this is a renamed version of the CanvasLayer node specific to Godot. In ACTION GAME MAKER, it is used as the display target for the Open/CloseMenu action to show or hide menus, and as the display target for HUD elements such as HP bars.
Note that since Parallax2D does not exist in the UI layer, it is not recognized as a layer within the visual scripting system. When generating objects in the menu layer, it is necessary to use [ObjectMountTarget] in conjunction.
Note on Layer Usage: Collision Processing
While each layer in ACTION GAME MAKER handles drawing order, collision processing is managed by CollisionLayer/Mask. Therefore, be aware that objects in the BaseLayer can collide with objects in the UI layer.