mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Sync classref with current source
Changes order of brief/long descriptions and removes category as per godotengine/godot#35132.
This commit is contained in:
@@ -9,13 +9,33 @@
|
||||
Dictionary
|
||||
==========
|
||||
|
||||
**Category:** Built-In Types
|
||||
|
||||
Brief Description
|
||||
-----------------
|
||||
|
||||
Dictionary type.
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference.
|
||||
|
||||
Erasing elements while iterating over them **is not supported**.
|
||||
|
||||
Creating a dictionary:
|
||||
|
||||
::
|
||||
|
||||
var d = {4: 5, "A key": "A value", 28: [1, 2, 3]}
|
||||
|
||||
To add a key to an existing dictionary, access it like an existing key and assign to it:
|
||||
|
||||
::
|
||||
|
||||
d[4] = "hello" # Add integer 4 as a key and assign the String "hello" as its value.
|
||||
d["Godot"] = 3.01 # Add String "Godot" as a key and assign the value 3.01 to it.
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- `#dictionary <../getting_started/scripting/gdscript/gdscript_basics.html#dictionary>`_ in :doc:`../getting_started/scripting/gdscript/gdscript_basics`
|
||||
|
||||
Methods
|
||||
-------
|
||||
|
||||
@@ -43,31 +63,6 @@ Methods
|
||||
| :ref:`Array<class_Array>` | :ref:`values<class_Dictionary_method_values>` **(** **)** |
|
||||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are always passed by reference.
|
||||
|
||||
Erasing elements while iterating over them **is not supported**.
|
||||
|
||||
Creating a dictionary:
|
||||
|
||||
::
|
||||
|
||||
var d = {4: 5, "A key": "A value", 28: [1, 2, 3]}
|
||||
|
||||
To add a key to an existing dictionary, access it like an existing key and assign to it:
|
||||
|
||||
::
|
||||
|
||||
d[4] = "hello" # Add integer 4 as a key and assign the String "hello" as its value.
|
||||
d["Godot"] = 3.01 # Add String "Godot" as a key and assign the value 3.01 to it.
|
||||
|
||||
Tutorials
|
||||
---------
|
||||
|
||||
- `#dictionary <../getting_started/scripting/gdscript/gdscript_basics.html#dictionary>`_ in :doc:`../getting_started/scripting/gdscript/gdscript_basics`
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user