Skip to content
Download

Layers

Every room is made of layers, stacked on top of each other. The Camadas (layers) panel sits on the left, below Recursos, and shows the layers of the open room. Like the other editor windows, it can be dragged somewhere else.

The layer at the top of the list is in front. The layer decides the drawing order: objects and instances no longer have a Depth.

Type What it holds What for
Instâncias (instances) Instances of objects The player, the enemies, everything with code
Tiles A grid of tiles from a tileset The floor, the walls, the painted scenery
Sprites Loose sprites, with no object and no code Decorations: a tree, a sign
Fundo (background) A color or an image The sky, the mountains far away

A new room already comes with two: Instancias and Fundo.

  • + Camada creates a layer of the type you choose, above the active layer.
  • Double-click the name to rename.
  • Drag a layer to change the order.
  • The eye hides the layer (in the editor and in the game). The padlock locks it: nothing in it can be touched in the view.
  • Right-click: Renomear (rename), Duplicar (duplicate) and Excluir (delete). Deleting a layer takes what is in it along; you can undo it.

The layer you clicked is the active one, and it is the one the mouse works on in the room view:

  • with an Instâncias layer active, you select and move its instances, and the objects dragged from Recursos go into it. The other instance layers look a little faded;
  • with a Sprites layer active, the sprites dragged from Recursos become loose sprites;
  • with a Tiles layer active, the mouse paints. See Tileset and tiles;
  • with a Fundo layer active, nothing in the view can be selected.

With no instance selected, the Inspector shows the active layer:

  • Depth: the number that orders the layers (higher = further behind). Reordering the list renumbers them 100 apart; you almost never need to touch it.
  • Visível (visible) and Travada (locked): the same as the eye and the padlock.
  • On a Fundo layer: the Cor (color), the Sprite (the image), Repetir (repeat) horizontally (H) and vertically (V), Esticar (stretch) to cover the room, the Posição (position) and the Velocidade (speed: the image moves by itself; good for clouds).
  • On a Tiles layer: the Tileset, Colide (collides) and the palette to paint with.

Select the instance. In the Inspector, under Transformação (transform), the Camada row shows its layer: choose another one.

Whatever is created by the code says which layer it goes into: spawn<Bullet>(x, y, "Tiros"). See Layers and tiles.

When you open a project made in 0.2, the editor asks whether it can convert it. The instances of each room are split by the depth they had: each depth becomes a layer (Instancias, Instancias_2…), and the background color becomes the Fundo layer. The room looks the same.

In the Inspector of an instance layer, Ordenar por Y (sort by Y) draws in front whoever is lower on the screen. It is what a top-down game needs: the player walks behind the tree without the code touching each instance’s depth. An instance whose depth was changed by code keeps its own.