Update gdscript cheatsheet.md

This commit is contained in:
Miloslav Číž 2018-05-07 20:14:42 +02:00 committed by GitHub
parent 7185744a43
commit f682a5885a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -14,6 +14,7 @@ Only the differences between the languages are mentioned.
| built-in types | basic:<br>`bool`, `int`, `float`, `complex`, `str`<br>container:<br>`list`, `dict`, `tuple`, `set`, ... | basic:<br>`null`, `bool`, `int`, `float`, `String`<br>container:<br>`Array`, `Dictionary`, `PoolByteArray`, ... <br>vector:<br>`Vector2`, `Vector3`, `Rect2`, `Transform2D`,`Transform`, `Basis`, `Quat`, `AABB`<br>engine:<br>`Color`, `NodePath`, `RID`, `Object`
| basic constants | `None`, `True`, `False` | `null`, `true`, `false` |
| constructor name | `__init__` | `_init`
| module importing | `import` keyword | `preload` keyword
| `self` variable | only in class functions, has to be an explicit argument (e.g. `__init__(self)`) | is always implicitly present (in non-static functions)
| variable definition | `x = 5` | `var x = 5` <br> or to assign when the node is ready: <br> `onready var x = 5` <br> or to export to GUI interface and save: <br> `export var x = 5`
| call superclass method | `super(SelfClass,self).method()` | `.method()` |