Get Dimensions of Node?

PendiPendi Posts: 9Member

Hey, I'm trying to figure out how to get the size of my camera node, however using self.size.x does not work


  • MegalomaniakMegalomaniak Posts: 2,892Admin

    What are you trying to do/achieve with that? If you want the screen resolution that is defined in the project settings.

  • PendiPendi Posts: 9Member

    Mainly I just want to know how to get the size of my nodes in general, like sprites and such, not the screen resolutioon

  • kryzmakkryzmak Posts: 109Member

    It depends on the node type. A sprite's size is given in pixel size of the texture, so Sprite.texture.get_size() will do the job. If you work with a 3D node, the size is defined by it's mesh. You can get the dimension with MeshInstance.mesh.size

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file