Fixed-position buttons on screen with zoomable tilemap in the background

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CKO

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?

:bust_in_silhouette: Reply From: MagnusS

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

CanvasLayer was exactly what I was looking for. Thanks!

CKO | 2019-03-01 14:58

Thanks, this also works for me

Denny3817 | 2021-03-04 17:51