+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?

in Engine by (101 points)

1 Answer

+4 votes
Best answer

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

by (330 points)
selected by

CanvasLayer was exactly what I was looking for. Thanks!

Thanks, this also works for me

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.