+1 vote

I have implemented a 2D tilemap with units running around on top and added a Camera2D to enable zooming, panning, etc. The node structure is as follows:

+ Root node (type Node)
    + Camera2D
    + TileMap
    + Unit 1
    + Unit 2
    + ....

The TileMap is added dynamically at startup and the units are added as needed

Now, I would like to add UI buttons at the edges of the screen that are fixed in position and are not zoomable. When I add the buttons at the same level as everything else, then they grow and shrink along with the tilemap and units and move around.

How can I arrange it so that the buttons are fixed in position on screen and not zoomable while the tilemap remains zoomable and pannable in the background?

asked Mar 1, 2019 in Engine by CKO (86 points)

1 Answer

+2 votes
Best answer

Take a look at the CanvasLayer node. That might be what you're looking for.

answered Mar 1, 2019 by MagnusS (110 points)
selected Mar 1, 2019 by CKO

CanvasLayer was exactly what I was looking for. Thanks!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.