summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/EditorPlugin.xml18
-rw-r--r--doc/classes/EditorTranslationParserPlugin.xml48
-rw-r--r--doc/classes/PhysicalBone3D.xml4
-rw-r--r--doc/classes/PhysicsDirectBodyState2D.xml8
-rw-r--r--doc/classes/PhysicsDirectBodyState3D.xml12
-rw-r--r--doc/classes/PhysicsServer2D.xml8
-rw-r--r--doc/classes/PhysicsServer3D.xml6
-rw-r--r--doc/classes/RigidBody2D.xml10
-rw-r--r--doc/classes/RigidBody3D.xml6
9 files changed, 93 insertions, 27 deletions
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 2fa791a9df..99fe9b4bb5 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -142,6 +142,15 @@
Adds a custom submenu under [b]Project > Tools >[/b] [code]name[/code]. [code]submenu[/code] should be an object of class [PopupMenu]. This submenu should be cleaned up using [code]remove_tool_menu_item(name)[/code].
</description>
</method>
+ <method name="add_translation_parser_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="parser" type="EditorTranslationParserPlugin">
+ </argument>
+ <description>
+ Registers a custom translation parser plugin for extracting translatable strings from custom files.
+ </description>
+ </method>
<method name="apply_changes" qualifiers="virtual">
<return type="void">
</return>
@@ -464,6 +473,15 @@
Removes a menu [code]name[/code] from [b]Project &gt; Tools[/b].
</description>
</method>
+ <method name="remove_translation_parser_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="parser" type="EditorTranslationParserPlugin">
+ </argument>
+ <description>
+ Removes a registered custom translation parser plugin.
+ </description>
+ </method>
<method name="save_external_data" qualifiers="virtual">
<return type="void">
</return>
diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml
new file mode 100644
index 0000000000..c7d796ec30
--- /dev/null
+++ b/doc/classes/EditorTranslationParserPlugin.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorTranslationParserPlugin" inherits="Reference" version="4.0">
+ <brief_description>
+ Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.).
+ </brief_description>
+ <description>
+ Plugins are registered via [method EditorPlugin.add_translation_parser_plugin] method. To define the parsing and string extraction logic, override the [method parse_text] method in script.
+ The extracted strings will be written into a POT file selected by user under "POT Generation" in "Localization" tab in "Project Settings" menu.
+ Below shows an example of a custom parser that extracts strings in a CSV file to write into a POT.
+ [codeblock]
+ tool
+ extends EditorTranslationParserPlugin
+
+ func parse_text(text, extracted_strings):
+ var split_strs = text.split(",", false, 0)
+ for s in split_strs:
+ extracted_strings.append(s)
+ #print("Extracted string: " + s)
+
+ func get_recognized_extensions():
+ return ["csv"]
+ [/codeblock]
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="get_recognized_extensions" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code].
+ </description>
+ </method>
+ <method name="parse_text" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="text" type="String">
+ </argument>
+ <argument index="1" name="extracted_strings" type="Array">
+ </argument>
+ <description>
+ Override this method to define a custom parsing logic to extract the translatable strings.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/PhysicalBone3D.xml b/doc/classes/PhysicalBone3D.xml
index 58930aae37..0808e4a724 100644
--- a/doc/classes/PhysicalBone3D.xml
+++ b/doc/classes/PhysicalBone3D.xml
@@ -18,9 +18,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="impulse" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
</description>
diff --git a/doc/classes/PhysicsDirectBodyState2D.xml b/doc/classes/PhysicsDirectBodyState2D.xml
index 46205fecd1..30519e11be 100644
--- a/doc/classes/PhysicsDirectBodyState2D.xml
+++ b/doc/classes/PhysicsDirectBodyState2D.xml
@@ -22,9 +22,9 @@
<method name="add_force">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="force" type="Vector2">
</argument>
- <argument index="1" name="force" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -51,9 +51,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2">
</argument>
- <argument index="1" name="impulse" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin.
diff --git a/doc/classes/PhysicsDirectBodyState3D.xml b/doc/classes/PhysicsDirectBodyState3D.xml
index 1ee520fe5f..eea681e696 100644
--- a/doc/classes/PhysicsDirectBodyState3D.xml
+++ b/doc/classes/PhysicsDirectBodyState3D.xml
@@ -12,7 +12,7 @@
<method name="add_central_force">
<return type="void">
</return>
- <argument index="0" name="force" type="Vector3">
+ <argument index="0" name="force" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a constant directional force without affecting rotation.
@@ -24,7 +24,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -42,7 +42,7 @@
<method name="apply_central_impulse">
<return type="void">
</return>
- <argument index="0" name="j" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a single directional impulse without affecting rotation.
@@ -52,9 +52,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="j" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.
@@ -63,7 +63,7 @@
<method name="apply_torque_impulse">
<return type="void">
</return>
- <argument index="0" name="j" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
<description>
Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector [code]j[/code] passed as parameter.
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml
index d7821b1045..b2904c6538 100644
--- a/doc/classes/PhysicsServer2D.xml
+++ b/doc/classes/PhysicsServer2D.xml
@@ -331,9 +331,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="offset" type="Vector2">
+ <argument index="1" name="force" type="Vector2">
</argument>
- <argument index="2" name="force" type="Vector2">
+ <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
@@ -379,9 +379,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="position" type="Vector2">
+ <argument index="1" name="impulse" type="Vector2">
</argument>
- <argument index="2" name="impulse" type="Vector2">
+ <argument index="2" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml
index e9e1552c92..5fd3ef5db2 100644
--- a/doc/classes/PhysicsServer3D.xml
+++ b/doc/classes/PhysicsServer3D.xml
@@ -334,7 +334,7 @@
</argument>
<argument index="1" name="force" type="Vector3">
</argument>
- <argument index="2" name="position" type="Vector3">
+ <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
</description>
@@ -379,9 +379,9 @@
</return>
<argument index="0" name="body" type="RID">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="impulse" type="Vector3">
</argument>
- <argument index="2" name="impulse" type="Vector3">
+ <argument index="2" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Gives the body a push at a [code]position[/code] in the direction of the [code]impulse[/code].
diff --git a/doc/classes/RigidBody2D.xml b/doc/classes/RigidBody2D.xml
index a3fd2e81fd..d56dc1e17c 100644
--- a/doc/classes/RigidBody2D.xml
+++ b/doc/classes/RigidBody2D.xml
@@ -34,9 +34,9 @@
<method name="add_force">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="force" type="Vector2">
</argument>
- <argument index="1" name="force" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates.
@@ -54,7 +54,7 @@
<method name="apply_central_impulse">
<return type="void">
</return>
- <argument index="0" name="impulse" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a directional impulse without affecting rotation.
@@ -63,9 +63,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="offset" type="Vector2">
+ <argument index="0" name="impulse" type="Vector2">
</argument>
- <argument index="1" name="impulse" type="Vector2">
+ <argument index="1" name="position" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin.
diff --git a/doc/classes/RigidBody3D.xml b/doc/classes/RigidBody3D.xml
index 063cc3ca59..efd55f5566 100644
--- a/doc/classes/RigidBody3D.xml
+++ b/doc/classes/RigidBody3D.xml
@@ -37,7 +37,7 @@
</return>
<argument index="0" name="force" type="Vector3">
</argument>
- <argument index="1" name="position" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Adds a constant directional force (i.e. acceleration).
@@ -66,9 +66,9 @@
<method name="apply_impulse">
<return type="void">
</return>
- <argument index="0" name="position" type="Vector3">
+ <argument index="0" name="impulse" type="Vector3">
</argument>
- <argument index="1" name="impulse" type="Vector3">
+ <argument index="1" name="position" type="Vector3" default="Vector3( 0, 0, 0 )">
</argument>
<description>
Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin.