Skip to content

Commit

Permalink
更新类文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwdit committed Oct 11, 2022
1 parent dd22578 commit 7204c16
Show file tree
Hide file tree
Showing 57 changed files with 1,822 additions and 516 deletions.
3 changes: 3 additions & 0 deletions libs/gui/resources/class_docs/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2818,6 +2818,9 @@
</constant>
<constant name="PROPERTY_USAGE_EDITOR_BASIC_SETTING" value="134217728" enum="PropertyUsageFlags">
</constant>
<constant name="PROPERTY_USAGE_READ_ONLY" value="268435456" enum="PropertyUsageFlags">
The property is read-only in the editor inspector.
</constant>
<constant name="PROPERTY_USAGE_ARRAY" value="536870912" enum="PropertyUsageFlags">
</constant>
<constant name="PROPERTY_USAGE_DEFAULT" value="6" enum="PropertyUsageFlags">
Expand Down
14 changes: 12 additions & 2 deletions libs/gui/resources/class_docs/AStarGrid2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
<description>
Compared to [AStar2D] you don't need to manually create points or connect them together. It also supports multiple type of heuristics and modes for diagonal movement. This class also provides a jumping mode which is faster to calculate than without it in the [AStar2D] class.
In contrast to [AStar2D], you only need set the [member size] of the grid, optionally set the [member cell_size] and then call the [method update] method:
[codeblock]
[codeblocks]
[gdscript]
var astar_grid = AStarGrid2D.new()
astar_grid.size = Vector2i(32, 32)
astar_grid.cell_size = Vector2(16, 16)
astar_grid.update()
print(astar_grid.get_id_path(Vector2i(0, 0), Vector2i(3, 4))) # prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
print(astar_grid.get_point_path(Vector2i(0, 0), Vector2i(3, 4))) # prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
[/codeblock]
[/gdscript]
[csharp]
AStarGrid2D astarGrid = new AStarGrid2D();
astarGrid.Size = new Vector2i(32, 32);
astarGrid.CellSize = new Vector2i(16, 16);
astarGrid.Update();
GD.Print(astarGrid.GetIdPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (1, 1), (2, 2), (3, 3), (3, 4)
GD.Print(astarGrid.GetPointPath(Vector2i.Zero, new Vector2i(3, 4))); // prints (0, 0), (16, 16), (32, 32), (48, 48), (48, 64)
[/csharp]
[/codeblocks]
</description>
<tutorials>
</tutorials>
Expand Down
54 changes: 54 additions & 0 deletions libs/gui/resources/class_docs/Array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
Constructs an empty [Array].
</description>
</constructor>
<constructor name="Array">
<return type="Array" />
<param index="0" name="base" type="Array" />
<param index="1" name="type" type="int" />
<param index="2" name="class_name" type="StringName" />
<param index="3" name="script" type="Variant" />
<description>
</description>
</constructor>
<constructor name="Array">
<return type="Array" />
<param index="0" name="from" type="Array" />
Expand Down Expand Up @@ -303,6 +312,21 @@
[b]Note:[/b] Calling this function is not the same as writing [code]array[0][/code]. If the array is empty, accessing by index will pause project execution when running from the editor.
</description>
</method>
<method name="get_typed_builtin" qualifiers="const">
<return type="int" />
<description>
</description>
</method>
<method name="get_typed_class_name" qualifiers="const">
<return type="StringName" />
<description>
</description>
</method>
<method name="get_typed_script" qualifiers="const">
<return type="Variant" />
<description>
</description>
</method>
<method name="has" qualifiers="const">
<return type="bool" />
<param index="0" name="value" type="Variant" />
Expand Down Expand Up @@ -366,6 +390,16 @@
Returns [code]true[/code] if the array is empty.
</description>
</method>
<method name="is_read_only" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="is_typed" qualifiers="const">
<return type="bool" />
<description>
</description>
</method>
<method name="map" qualifiers="const">
<return type="Array" />
<param index="0" name="method" type="Callable" />
Expand Down Expand Up @@ -479,6 +513,20 @@
Searches the array in reverse order. Optionally, a start search index can be passed. If negative, the start index is considered relative to the end of the array.
</description>
</method>
<method name="set_read_only">
<return type="void" />
<param index="0" name="enable" type="bool" />
<description>
</description>
</method>
<method name="set_typed">
<return type="void" />
<param index="0" name="type" type="int" />
<param index="1" name="class_name" type="StringName" />
<param index="2" name="script" type="Variant" />
<description>
</description>
</method>
<method name="shuffle">
<return type="void" />
<description>
Expand Down Expand Up @@ -556,6 +604,12 @@
[/codeblocks]
</description>
</method>
<method name="typed_assign">
<return type="bool" />
<param index="0" name="array" type="Array" />
<description>
</description>
</method>
</methods>
<operators>
<operator name="operator !=">
Expand Down
7 changes: 7 additions & 0 deletions libs/gui/resources/class_docs/Callable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
[/codeblock]
</description>
</method>
<method name="callv" qualifiers="const">
<return type="Variant" />
<param index="0" name="arguments" type="Array" />
<description>
Calls the method represented by this [Callable]. Contrary to [method call], this method does not take a variable number of arguments but expects all arguments to be passed via a single [Array].
</description>
</method>
<method name="get_method" qualifiers="const">
<return type="StringName" />
<description>
Expand Down
6 changes: 3 additions & 3 deletions libs/gui/resources/class_docs/Camera2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
<member name="editor_draw_screen" type="bool" setter="set_screen_drawing_enabled" getter="is_screen_drawing_enabled" default="true">
If [code]true[/code], draws the camera's screen rectangle in the editor.
</member>
<member name="ignore_rotation" type="bool" setter="set_ignore_rotation" getter="is_ignoring_rotation" default="true">
If [code]true[/code], the camera's rendered view is not affected by its [member Node2D.rotation] and [member Node2D.global_rotation].
</member>
<member name="limit_bottom" type="int" setter="set_limit" getter="get_limit" default="10000000">
Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit.
</member>
Expand All @@ -147,9 +150,6 @@
<member name="process_callback" type="int" setter="set_process_callback" getter="get_process_callback" enum="Camera2D.Camera2DProcessCallback" default="1">
The camera's process callback. See [enum Camera2DProcessCallback].
</member>
<member name="rotating" type="bool" setter="set_rotating" getter="is_rotating" default="false">
If [code]true[/code], the camera view rotates with the target.
</member>
<member name="smoothing_enabled" type="bool" setter="set_enable_follow_smoothing" getter="is_follow_smoothing_enabled" default="false">
If [code]true[/code], the camera smoothly moves towards the target at [member smoothing_speed].
</member>
Expand Down
Loading

0 comments on commit 7204c16

Please sign in to comment.