Hello everyone,

I'd like to improve the camera code on my game and I was desperately looking how to get the position of a node relative to the edge of the game window (as an example, I'd like to make something happen if a body gets N pixels close to the bottom of the window. How do I get this ?

Thanks for your help !

PS : the camera window is already defined as 360x360 pixels

  • I think there might be something useful in the viewport class. Or maybe I'm thinking of something in canvasitem class related to viewport...in that case it doesn't help with a node2D derivative I suppose.

I think there might be something useful in the viewport class. Or maybe I'm thinking of something in canvasitem class related to viewport...in that case it doesn't help with a node2D derivative I suppose.

    Megalomaniak
    OK, thank you for the tip, I will have a look at canvas properties in the the online docs.
    By the way, something was wrong in my code and I have fixed the issue, so no more need to look for something more complicated.