diff --git a/development/cpp/custom_modules_in_cpp.rst b/development/cpp/custom_modules_in_cpp.rst index 549294de4..72db09180 100644 --- a/development/cpp/custom_modules_in_cpp.rst +++ b/development/cpp/custom_modules_in_cpp.rst @@ -34,24 +34,14 @@ instead. Adding C++ modules can be useful in the following scenarios: Creating a new module --------------------- -Before creating a module, make sure to download the source code of Godot -and manage to compile it. There are tutorials in the documentation for this. +Before creating a module, make sure to :ref:`download the source code of Godot +and compile it `. To create a new module, the first step is creating a directory inside ``modules/``. If you want to maintain the module separately, you can checkout a different VCS into modules and use it. -The example module will be called "summator", and is placed inside the -Godot source tree (``C:\godot`` refers to wherever the Godot sources are -located): - -.. code-block:: console - - C:\godot> cd modules - C:\godot\modules> mkdir summator - C:\godot\modules> cd summator - C:\godot\modules\summator> - +The example module will be called "summator" (``godot/modules/summator``). Inside we will create a simple summator class: .. code-block:: cpp @@ -240,7 +230,8 @@ Using the module You can now use your newly created module from any script: -:: +.. tabs:: + .. code-tab:: gdscript GDScript var s = Summator.new() s.add(10)