How to draw to the screen coordinates properly?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Ricardo Noriega
:warning: Old Version Published before Godot 3 was released.

To add more to the question, I have a Dialogue Box scene and I instantiate it when I speak to NPCs, my question is where and how do I position this Dialogue Box? I tried using get_camera_screen_center() and it was successful to a degree. If I move around the place while the Dialogue Box is open, my guess is that in an effort to keep up with the screen center, the instance jitters like crazy, the same thing happens if I set the position equal to the player.

Basically, is there a function similar to GameMaker’s ‘Draw GUI’ event? Where things drawn in that event are drawn directly to the screen and not to the game, if that makes any sense.

Thanks.

Hi Ricardo

Godot has a node that will help you with that, to add all that static content on the camera like the HUD / GUI, that node is called CanvasLayer, this will allow you if your character moves along with the camera, these elements do not move and you can sort them by layers.

Aquiles | 2017-02-03 07:05