How to see all the function supported by a node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lestat

If I create my 1st node using a [node2D] and add a [sprite] as its child node. How could I see all the API supported by node2D and in return what API can be used by the child node? I understand that child node inherits parent node’s API.

And how could I see the API unique to each node such as the sprite node?

“The role of the script
A script adds behavior to a node. It is used to control how the node functions as well as how it interacts with other nodes: children, parent, siblings, and so on. The local scope of the script is the node. In other words, the script inherits the functions provided by that node.”

:bust_in_silhouette: Reply From: p7f

Hi,
In first place, yes… nodes should inherit all the parents methods and attributes. But this apply to the methods and properties of the class it derives! Not of the parent in the tree structure of your scene. Do i explaim myself? For example? Button derives from Control, So it inherits it methods. But if you place a button inside a Area2D, Button won’t inherit Area2D’s methods

About the functions supported, i alway look for the node in the docs, and if there is no function that does what i want there, i star looking in the classes from which it derives. Those classes are linked at the top of each node’s doc.

Also, you can try pressing alt+space in the editor when extending the node you are interested in. In most editors, alt+space lists all possible completions. For example, if you want to see the available functions and properties of an Area2D that is child of your root node, you can write:

$Area2D.

An right after the “.” Press alt+space. (If the node is called Area2D of course)