[Docs] Description updates for Node2D & Object
This commit is contained in:
parent
2e76c7ce19
commit
bc234ce0ae
2 changed files with 8 additions and 2 deletions
|
|
@ -9,6 +9,12 @@
|
|||
Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the [method free] method from your script or delete the instance from C++.
|
||||
Some classes that extend Object add memory management. This is the case of [Reference], which counts references and deletes itself automatically when no longer referenced. [Node], another fundamental type, deletes all its children when freed from memory.
|
||||
Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in [method _get_property_list] and handled in [method _get] and [method _set]. However, scripting languages and C++ have simpler means to export them.
|
||||
Property membership can be tested directly in GDScript using [code]in[/code]:
|
||||
[codeblock]
|
||||
var n = Node2D.new()
|
||||
print("position" in n) # Prints "True".
|
||||
print("other_property" in n) # Prints "False".
|
||||
[/codeblock]
|
||||
Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See [method _notification].
|
||||
</description>
|
||||
<tutorials>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue