Skip to content
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

Use [codeblock lang=text] more often in class reference #89316

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
<param index="1" name="curve" type="float" />
<description>
Returns an "eased" value of [param x] based on an easing function defined with [param curve]. This easing function is based on an exponent. The [param curve] can be any floating-point number, with specific values leading to the following behaviors:
[codeblock]
[codeblock lang=text]
- Lower than -1.0 (exclusive): Ease in-out
- 1.0: Linear
- Between -1.0 and 0.0 (exclusive): Ease out-in
Expand Down Expand Up @@ -460,8 +460,8 @@
var x = i * 0.5 - 1.5
print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])
[/codeblock]
Produces:
[codeblock]
Prints:
[codeblock lang=text]
(x) (fmod(x, 1.5)) (fposmod(x, 1.5))
-1.5 -0.0 | 0.0
-1.0 -1.0 | 0.5
Expand Down Expand Up @@ -818,8 +818,8 @@
for i in range(-3, 4):
print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)])
[/codeblock]
Produces:
[codeblock]
Prints:
[codeblock lang=text]
(i) (i % 3) (posmod(i, 3))
-3 0 | 0
-2 -2 | 1
Expand Down Expand Up @@ -1457,7 +1457,7 @@
[/csharp]
[/codeblocks]
Prints:
[codeblock]
[codeblock lang=text]
{
"a": 1,
"b": 2
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/ConfigFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</brief_description>
<description>
This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are identified by a section and a key:
[codeblock]
[codeblock lang=text]
[section]
some_key=42
string_example="Hello World3D!"
Expand Down
28 changes: 14 additions & 14 deletions doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<param index="0" name="position" type="Vector2i" />
<description>
Returns the ID of the window at the specified screen [param position] (in pixels). On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
[codeblock]
[codeblock lang=text]
* (0, 0) +-------+
| |
+-------------+ | |
Expand Down Expand Up @@ -282,7 +282,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -308,7 +308,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -334,7 +334,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -361,7 +361,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -386,7 +386,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand Down Expand Up @@ -415,7 +415,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -441,7 +441,7 @@
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -459,7 +459,7 @@
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -479,7 +479,7 @@
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand All @@ -495,7 +495,7 @@
Removes all items from the global menu with ID [param menu_root].
[b]Note:[/b] This method is implemented only on macOS.
[b]Supported system menu IDs:[/b]
[codeblock]
[codeblock lang=text]
"_main" - Main menu (macOS).
"_dock" - Dock popup menu (macOS).
"_apple" - Apple menu (macOS, custom items added before "Services").
Expand Down Expand Up @@ -1022,7 +1022,7 @@
Returns the dots per inch density of the specified screen. If [param screen] is [constant SCREEN_OF_MAIN_WINDOW] (the default value), a screen with the main window will be used.
[b]Note:[/b] On macOS, returned value is inaccurate if fractional display scaling mode is used.
[b]Note:[/b] On Android devices, the actual screen densities are grouped into six generalized densities:
[codeblock]
[codeblock lang=text]
ldpi - 120 dpi
mdpi - 160 dpi
hdpi - 240 dpi
Expand Down Expand Up @@ -1072,7 +1072,7 @@
<param index="0" name="screen" type="int" default="-1" />
<description>
Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
[codeblock]
[codeblock lang=text]
* (0, 0) +-------+
| |
+-------------+ | |
Expand Down Expand Up @@ -1674,7 +1674,7 @@
<param index="1" name="window_id" type="int" default="0" />
<description>
Sets the position of the given window to [param position]. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this:
[codeblock]
[codeblock lang=text]
* (0, 0) +-------+
| |
+-------------+ | |
Expand Down
6 changes: 3 additions & 3 deletions doc/classes/EditorPaths.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<description>
Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails).
[b]Default paths per platform:[/b]
[codeblock]
[codeblock lang=text]
- Windows: %LOCALAPPDATA%\Godot\
- macOS: ~/Library/Caches/Godot/
- Linux: ~/.cache/godot/
Expand All @@ -29,7 +29,7 @@
<description>
Returns the absolute path to the user's configuration folder. This folder should be used for [i]persistent[/i] user configuration files.
[b]Default paths per platform:[/b]
[codeblock]
[codeblock lang=text]
- Windows: %APPDATA%\Godot\ (same as `get_data_dir()`)
- macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`)
- Linux: ~/.config/godot/
Expand All @@ -41,7 +41,7 @@
<description>
Returns the absolute path to the user's data folder. This folder should be used for [i]persistent[/i] user data files such as installed export templates.
[b]Default paths per platform:[/b]
[codeblock]
[codeblock lang=text]
- Windows: %APPDATA%\Godot\ (same as `get_config_dir()`)
- macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`)
- Linux: ~/.local/share/godot/
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/FileAccess.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long, and cannot be a double quotation mark.
Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence.
For example, the following CSV lines are valid and will be properly parsed as two strings each:
[codeblock]
[codeblock lang=text]
Alice,"Hello, Bob!"
Bob,Alice! What a surprise!
Alice,"I thought you'd reply with ""Hello, world""."
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/InputEventKey.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character.
For keyboard layouts with a single label on the key, it is equivalent to [member keycode].
To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.key_label)[/code] where [code]event[/code] is the [InputEventKey].
[codeblock]
[codeblock lang=text]
+-----+ +-----+
| Q | | Q | - "Q" - keycode
| Й | | ض | - "Й" and "ض" - key_label
Expand All @@ -76,7 +76,7 @@
<member name="keycode" type="int" setter="set_keycode" getter="get_keycode" enum="Key" default="0">
Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants.
To get a human-readable representation of the [InputEventKey], use [code]OS.get_keycode_string(event.keycode)[/code] where [code]event[/code] is the [InputEventKey].
[codeblock]
[codeblock lang=text]
+-----+ +-----+
| Q | | Q | - "Q" - keycode
| Й | | ض | - "Й" and "ض" - key_label
Expand Down
18 changes: 9 additions & 9 deletions doc/classes/Node.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns [code]null[/code]. Attempts to access methods on the return value will result in an [i]"Attempt to call &lt;method&gt; on a null instance."[/i] error.
[b]Note:[/b] Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]).
[b]Example:[/b] Assume this method is called from the Character node, inside the following tree:
[codeblock]
[codeblock lang=text]
┖╴root
┠╴Character (you are here!)
┃ ┠╴Sword
Expand Down Expand Up @@ -514,8 +514,8 @@
<return type="String" />
<description>
Returns the tree as a [String]. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the [method get_node] function. It also can be used in game UI/UX.
[b]Example output:[/b]
[codeblock]
May print, for example:
[codeblock lang=text]
TheGame
TheGame/Menu
TheGame/Menu/Label
Expand All @@ -529,8 +529,8 @@
<return type="String" />
<description>
Similar to [method get_tree_string], this returns the tree as a [String]. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.
[b]Example output:[/b]
[codeblock]
May print, for example:
[codeblock lang=text]
┖╴TheGame
┠╴Menu
┃ ┠╴Label
Expand Down Expand Up @@ -716,8 +716,8 @@
<return type="void" />
<description>
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs [NodePath]s relative to this node, and is good for copy/pasting into [method get_node]. See also [method print_tree_pretty].
[b]Example output:[/b]
[codeblock]
May print, for example:
[codeblock lang=text]
.
Menu
Menu/Label
Expand All @@ -731,8 +731,8 @@
<return type="void" />
<description>
Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to [method print_tree], but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees.
[b]Example output:[/b]
[codeblock]
May print, for example:
[codeblock lang=text]
┖╴TheGame
┠╴Menu
┃ ┠╴Label
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@
The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself.
It is possible to make another executable run Godot by using the [code]%command%[/code] placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed [i]before[/i] the placeholder, whereas Godot-specific arguments should be placed [i]after[/i] the placeholder.
For example, this can be used to force the project to run on the dedicated GPU in an NVIDIA Optimus system on Linux:
[codeblock]
[codeblock lang=text]
prime-run %command%
[/codeblock]
</member>
Expand Down Expand Up @@ -2855,7 +2855,7 @@
<member name="rendering/vrs/texture" type="String" setter="" getter="" default="&quot;&quot;">
If [member rendering/vrs/mode] is set to [b]Texture[/b], this is the path to default texture loaded as the VRS image.
The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
[codeblock]
[codeblock lang=text]
- 1×1 = rgb(0, 0, 0) - #000000
- 1×2 = rgb(0, 85, 0) - #005500
- 2×1 = rgb(85, 0, 0) - #550000
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,7 @@
<description>
Set the entire data to use for drawing the [param multimesh] at once to [param buffer] (such as instance transforms and colors). [param buffer]'s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also [method multimesh_get_buffer].
The per-instance data size and expected data order is:
[codeblock]
[codeblock lang=text]
2D:
- Position: 8 floats (8 floats for Transform2D)
- Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/ResourceImporterCSVTranslation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>
Comma-separated values are a plain text table storage format. The format's simplicity makes it easy to edit in any text editor or spreadsheet software. This makes it a common choice for game localization.
[b]Example CSV file:[/b]
[codeblock]
[codeblock lang=text]
keys,en,es,ja
GREET,"Hello, friend!","Hola, amigo!",こんにちは
ASK,How are you?,Cómo está?,元気ですか
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/SkeletonProfileHumanoid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>
A [SkeletonProfile] as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only.
A humanoid skeleton profile contains 54 bones divided in 4 groups: [code]"Body"[/code], [code]"Face"[/code], [code]"LeftHand"[/code], and [code]"RightHand"[/code]. It is structured as follows:
[codeblock]
[codeblock lang=text]
Root
└─ Hips
├─ LeftUpperLeg
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/StyleBoxFlat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew.
Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system.
[b]Example:[/b]
[codeblock]
[codeblock lang=text]
height = 30
corner_radius_top_left = 50
corner_radius_bottom_left = 100
[/codeblock]
The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will [b]never[/b] be more than the height. Result:
[codeblock]
[codeblock lang=text]
corner_radius_top_left: 10
corner_radius_bottom_left: 20
[/codeblock]
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
<member name="vrs_texture" type="Texture2D" setter="set_vrs_texture" getter="get_vrs_texture">
Texture to use when [member vrs_mode] is set to [constant Viewport.VRS_TEXTURE].
The texture [i]must[/i] use a lossless compression format so that colors can be matched precisely. The following VRS densities are mapped to various colors, with brighter colors representing a lower level of shading precision:
[codeblock]
[codeblock lang=text]
- 1×1 = rgb(0, 0, 0) - #000000
- 1×2 = rgb(0, 85, 0) - #005500
- 2×1 = rgb(85, 0, 0) - #550000
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/doc_classes/EditorExportPlatformIOS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<members>
<member name="application/additional_plist_content" type="String" setter="" getter="">
Additional data added to the root [code]&lt;dict&gt;[/code] section of the [url=https://developer.apple.com/documentation/bundleresources/information_property_list]Info.plist[/url] file. The value should be an XML section with pairs of key-value elements, e.g.:
[codeblock]
[codeblock lang=text]
&lt;key&gt;key_name&lt;/key&gt;
&lt;string&gt;value&lt;/string&gt;
[/codeblock]
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/doc_classes/EditorExportPlatformMacOS.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<members>
<member name="application/additional_plist_content" type="String" setter="" getter="">
Additional data added to the root [code]&lt;dict&gt;[/code] section of the [url=https://developer.apple.com/documentation/bundleresources/information_property_list]Info.plist[/url] file. The value should be an XML section with pairs of key-value elements, e.g.:
[codeblock]
[codeblock lang=text]
&lt;key&gt;key_name&lt;/key&gt;
&lt;string&gt;value&lt;/string&gt;
[/codeblock]
Expand Down
Loading