Fix class name : change "string" to "String"

Change case of "s" letter : "string" does not compile but "String" does (for gdScript)

(cherry picked from commit 55b63eceaa22f979bd40656fb8444cc94a7942b7)
This commit is contained in:
dtesniere 2022-05-29 00:40:56 +02:00 committed by Relintai
parent a53e42504a
commit 690b82ff41

View File

@ -31,7 +31,7 @@
[/codeblock] [/codeblock]
You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
[codeblock] [codeblock]
export(string, "White", "Yellow", "Orange") var my_color export(String, "White", "Yellow", "Orange") var my_color
var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
func _ready(): func _ready():
# We can't use dot syntax here as `my_color` is a variable. # We can't use dot syntax here as `my_color` is a variable.