Commit Graph

105 Commits

Author SHA1 Message Date
Rémi Verschelde 166df0896c Fix typos with codespell
Using codespell 2.3-dev from current git.

And fix typo in `methods.py` for `vsproj=yes` option (still won't work
though).
2022-09-30 14:23:36 +02:00
Hugo Locurcio 530e31d4a3
Document `print_stack()` and `get_stack()` requiring a debugger connection 2022-09-28 12:24:39 +02:00
I Woithe 4c785ae3f8
Spelling correction: change "no" to "not" 2022-09-17 21:02:54 +09:30
Jummit 899b73e01d Remove outdated assert example 2022-09-11 07:55:03 +02:00
Hugo Locurcio f7292dbeb3
Rename `or_lesser` range property hint to `or_less`
"less" should be used for quantity, rather than "lesser".

Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
2022-09-02 19:08:20 +02:00
Micky 59e11934d8 Rename `str2var` to `str_to_var` and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
Yuri Sizov a0995182fe Add documentation for all annotations 2022-08-19 15:06:39 +03:00
Yuri Sizov c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
Raul Santos e47ba81050
Add `@GDScript.type_exists` documentation 2022-08-08 15:40:32 +02:00
Rémi Verschelde fa2dcc7ace
Merge pull request #47935 from HaSa1002/doc-loading-run-time 2022-07-20 22:33:49 +02:00
Yuri Sizov 316f78a037 Add default argument bindings to GDScript annotations 2022-07-11 23:02:55 +03:00
Rémi Verschelde 09e12ba9b4 Sync GDScript doc template for new annotations 2022-07-06 16:37:40 +02:00
Yuri Sizov a9098e6147 Add support for documenting built-in annotations 2022-07-04 20:21:39 +03:00
Johannes Witt 8c7d4996c9
Document how to load Images and MP3 files at run-time 2022-06-16 13:18:36 +02:00
Eduardo Rodrigues b2841ce194 Improve description for GDScript built-in range
Rewrites the definition of how the function works.
Reworks the style of the examples and adds a negative range example.
Changes the while loop to a range loop in the array backwards example.
2022-04-30 15:17:17 -03:00
Yuri Roubinsky 540fca147d Fix typo in `GDScript::range` doc 2022-04-20 19:38:49 +03:00
Markus Sauermann bac8e451c0 Describe usage of float in range documentation 2022-02-18 00:59:22 +01:00
Hugo Locurcio b68dd2e189
Add an XML schema for documentation
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.
2022-02-15 00:03:31 +01:00
Yuri Roubinsky ce48604eb7 Enchance descriptions of @GlobalScope/@GDScript 2021-11-25 14:24:09 +03:00
Rémi Verschelde 6c1bd4d227
Replace Godot docs URL with `$DOCS_URL` in XML class reference 2021-11-15 13:02:21 +01:00
Brian Semrau d3051b2637 GDScript gracefully handle debug functions from separate thread 2021-11-01 12:13:25 -04:00
Rémi Verschelde 862994a8ef
doc: Update links to latest documentation after content reorganization 2021-10-06 13:48:48 +02:00
Hugo Locurcio 810d8f06b7
Add an example on iterating an array backwards
This closes https://github.com/godotengine/godot-docs/issues/3472.
2021-09-30 20:29:57 +02:00
Aaron Franke d54f2ad7ca
Don't generate empty doc sections and reduce code duplication 2021-09-20 20:59:33 -05:00
Rémi Verschelde 7adf4cc9b5
doc: Use self-closing tags for `return` and `argument`
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.
2021-07-30 15:29:52 +02:00
Hugo Locurcio 8ff8c1e5f8
Improve documentation for GDScript constants 2021-07-22 09:50:24 +02:00
Lightning_A e28fd07b2b Rename `instance()`->`instantiate()` when it's a verb 2021-06-19 20:49:18 -06:00
Heikki Simojoki 09a905ca80
Increase String::num default decimal precision
Fixes #34541

Renamed MAX_DIGITS to MAX_DECIMALS, since it only changes the
amount of digits after the decimal point.

Increased MAX_DECIMALS to 32, and made String::num use
MAX_DECIMALS consistently. If -1 is passed as
decimal precision to String::num, it now gets changed to
the correct precision based on the number's magnitude,
instead of using printf default(which is 6)

String::num_real also calculates the correct precision now.

Also made the types used in floating-point math more
consistent in a few places.
2021-05-29 11:24:57 -04:00
Rémi Verschelde 215d18814e
doc: Sync classref with current source 2021-01-04 14:33:44 +01:00
Marcel Admiraal b743a2ef3c Rename Math::stepify to snapped 2020-12-28 13:01:30 +00:00
skyace65 4fd20015f3 Pow method doc fix 2020-12-13 17:53:30 -05:00
Danil Alexeev bf96056ad0 Several edits to the GDScript docs 2020-12-01 16:05:10 +03:00
George Marques fbb806fd68
Unregister GDScriptFunctionState class
This is not user accessible anymore so it does not need to be show in
documentation.
2020-11-26 21:39:54 -03:00
Rémi Verschelde 68067b8d97
Merge pull request #43423 from Calinou/doc-assert-avoid-side-effects
Clarify that code in `assert()` should avoid side effects
2020-11-10 11:31:28 +01:00
Rémi Verschelde 0f249f5c0a
Variant: Sync docs with new constructors, fixups after #43403
Change DocData comparators for MethodDoc and ArgumentDoc to get a better
ordering of constructors.
2020-11-09 23:39:53 +01:00
Hugo Locurcio d6c7073bd7
Clarify that code in `assert()` should avoid side effects 2020-11-09 21:48:24 +01:00
Yuri Roubinsky 38fb26794b Exposed randi_range to global funcs + renamed rand_range to randf_range 2020-11-06 17:06:26 +03:00
Hugo Locurcio 802c1e4df1
Link the Random number generation tutorial in the class reference 2020-10-14 18:03:29 +02:00
Rémi Verschelde 3556bc48a1
Merge pull request #42439 from Xrayez/doc-gdscript-load-and-resloader-xref
Cross-reference GDScript `load` and `ResourceLoader.load` in classref
2020-10-04 20:48:07 +02:00
Serhat 9f2cdfea82 Fixed padding bug of sprintf function 2020-10-02 00:25:42 +03:00
Andrii Doroshenko (Xrayez) a8404cf56c Cross-reference GDScript `load` and `ResourceLoader.load` in classref
The GDScript `load` mention is moved from the class `ResourceLoader`
description to the `ResourceLoader.load` method description instead,
where it is more likely to be found.
2020-09-30 23:03:36 +03:00
Hugo Locurcio 50f3a8e312
Improve documentation related to printing error/warning messages 2020-09-24 14:23:53 +02:00
Danil Alexeev a4c5790350 Several documentation improvements 2020-09-14 20:02:19 +03:00
Hugo Locurcio c4903a603b
Add link titles for all links in the class reference
This makes them display in a nicer way in the editor help.
(The title will display instead of the full URL.)
2020-08-31 14:22:07 +02:00
Hugo Locurcio 20d0f5bbd7
Cross-reference GDScript built-in rounding methods to ease discovery
This closes #19315.
2020-08-28 17:04:22 +02:00
Rémi Verschelde ba853f86af
Merge pull request #40903 from Calinou/doc-json
Improve JSON-related documentation
2020-07-31 10:39:56 +02:00
Hugo Locurcio 930e10ffff Improve JSON-related documentation
This closes https://github.com/godotengine/godot-docs/issues/3848.
2020-07-31 09:56:11 +02:00
Rémi Verschelde 9833f9cc11 doc: Fix typo in BBcode tag 2020-07-30 16:24:37 +02:00
Rémi Verschelde 932b75e247 doc: Sync classref with current source 2020-07-28 01:08:44 +02:00
Meriipu 7f9bfee0ac GDScript: Clarified/fixed inaccuracies in the built-in function docs.
The input to smoothstep is not actually a weight, and the decscription
of smoothstep was pretty hard to understand and easy to misinterpret.

Clarified what it means to be approximately equal.

nearest_po2 does not do what the descriptions says it does. For one,
it returns the same power if the input is a power of 2. Second, it
returns 0 if the input is negative or 0, while the smallest possible
integral power of 2 actually is 1 (2^0 = 1). Due to the implementation
and how it is used in a lot of places, it does not seem wise to change
such a core function however, and I decided it is better to alter the
description of the built-in.

Added a few examples/clarifications/edge-cases.
2020-07-25 20:26:02 +02:00