The docs specify that Array.remove does nothing if the index does not
exist. Array.erase does not have a similar phrase, so it's unclear if
erase will print an error, or silently do nothing.
This makes it easier to spot syntax errors when editing the
class reference. The schema is referenced locally so validation
can still work offline.
Each class XML's schema conformance is also checked on GitHub Actions.
The documentation for the sort method warns the user that it doesn't do natural sort but fails to provide a solution when it's just a one liner thanks to String.naturalnocasecmp_to() and lambda support
This suggests exactly the same algorithm as used by the filesystem dock for file sorting.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
The same is done for `Vector` (and thus `Packed*Array`).
`begin` and `end` can now take any value and will be clamped to
`[-size(), size()]`. Negative values are a shorthand for indexing the array
from the last element upward.
`end` is given a default `INT_MAX` value (which will be clamped to `size()`)
so that the `end` parameter can be omitted to go from `begin` to the max size
of the array.
This makes `slice` works similarly to numpy's and JavaScript's.
For the time being we don't support writing a description for those, preferring
having all details in the method's description.
Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
This pull request fixes an assortment of typos and improves conciseness in `Animation`, `Area2D`, `Array`, `ArrayMesh`, `Control`, `Directory`, `EditorPlugin`, `Engine`, and `OS`.
Includes:
* Variant
* Viewport
and two fixes in Array that were pointed out in #40978
VisualScript classes are skipped on purpose.
That is the final commit of the inital code porting to C#. :)
- Mention Lua-style syntax.
- Make the code samples self-contained.
- Mention caveat with `const` (also in Array).
- Clarify the description of `size()`.
This closes https://github.com/godotengine/godot-docs/issues/4272.
Only existing GDScript code examples are converted and added to the
docs.
This is the first batch include classes beginning with A and B.
Included classes:
* AcceptDialog
* AESContext
* Animation
* AnimationNodeStateMachine
* AnimationNodeStateMachinePlayback
* AnimationNodeStateMachineTransition
* Array
* ArrayMesh
* AStar
* AStar2D
* Bool
* Button