-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
GDScript: Document static variables #7524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
38f23de to
86d74d2
Compare
| func _init(): | ||
| super(5) | ||
|
|
||
| Static constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Static constructor | |
| Static initializer |
?
NathanLovato
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution overall, I left some suggestions that I think would help make this more accessible.
| B.x = 3 | ||
| prints(A.x, B.x) # 3 3 | ||
|
|
||
| Static functions can use static member variables. A static variable initializer can call a static function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first sentence is mentioned before. The second sentence means that you can write something like this, right?
static var a = some_static_function(value)
If so, it'd be good to have a snippet here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this as it's more related to #7507.
86d74d2 to
e297003
Compare
|
This change also fixes #7487. |
e297003 to
8488729
Compare
MisoMosiSpy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me now, thanks!
|
@NathanLovato any other changes you think need to be made? |
|
@skyace65 all good! |
|
Thanks! |
GDScript: Document static variables
Draft because godotengine/godot#77129 hasn't been merged yet.Comments are very welcome.