How to know the screen position of a node2D?
get_global_transform_with_canvas() will return a node's transform relative to your viewport. The o property of this will be that transform's origin (position if you will).
As of 3.1.1, o had been renamed to origin so get_global_transform_with_canvas().origin
Perhaps i'm mistaken, but in my tests, getglobaltransformwithcanvas().origin is giving me the global position, not relative to the viewport... how can i get that position? I need to use it on a shader.
It returns the position to the top-left corner of the window for me in the 2D Platformer demo. You probably wanna open a new question for this.
But doesn't the node.get_global_pos() gives the position on the "world"?
If a camera is centered on a node, the node will always be centered on the screen (same screen position always), but the node global pos will be changed as the node is moved.