|
43 | 43 | assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check. |
44 | 44 | assert(speed < 20, "the speed limit is 20") # Show a message. |
45 | 45 | [/codeblock] |
| 46 | + [b]Note:[/b] [method assert] is a keyword, not a function. So you cannot access it as a [Callable] or use it inside expressions. |
46 | 47 | </description> |
47 | 48 | </method> |
48 | 49 | <method name="char"> |
|
131 | 132 | - A constant from the [enum Variant.Type] enumeration, for example [constant TYPE_INT]. |
132 | 133 | - An [Object]-derived class which exists in [ClassDB], for example [Node]. |
133 | 134 | - A [Script] (you can use any class, including inner one). |
134 | | - Unlike the right operand of the [code]is[/code] operator, [param type] can be a non-constant value. The [code]is[/code] operator supports more features (such as typed arrays) and is more performant. Use the operator instead of this method if you do not need dynamic type checking. |
| 135 | + Unlike the right operand of the [code]is[/code] operator, [param type] can be a non-constant value. The [code]is[/code] operator supports more features (such as typed arrays). Use the operator instead of this method if you do not need dynamic type checking. |
135 | 136 | Examples: |
136 | 137 | [codeblock] |
137 | 138 | print(is_instance_of(a, TYPE_INT)) |
|
183 | 184 | # Create instance of a scene. |
184 | 185 | var diamond = preload("res://diamond.tscn").instantiate() |
185 | 186 | [/codeblock] |
| 187 | + [b]Note:[/b] [method preload] is a keyword, not a function. So you cannot access it as a [Callable]. |
186 | 188 | </description> |
187 | 189 | </method> |
188 | 190 | <method name="print_debug" qualifiers="vararg"> |
|
717 | 719 | <return type="void" /> |
718 | 720 | <description> |
719 | 721 | Make a script with static variables to not persist after all references are lost. If the script is loaded again the static variables will revert to their default values. |
| 722 | + [b]Note:[/b] As annotations describe their subject, the [annotation @static_unload] annotation must be placed before the class definition and inheritance. |
| 723 | + [b]Warning:[/b] Currently, due to a bug, scripts are never freed, even if [annotation @static_unload] annotation is used. |
720 | 724 | </description> |
721 | 725 | </annotation> |
722 | 726 | <annotation name="@tool"> |
|
0 commit comments