Преглед на файлове

Fix links to methods in the class reference

Rémi Verschelde преди 9 години
родител
ревизия
adfb7f9bd5

+ 2 - 2
classes/_classes.rst

@@ -1,5 +1,5 @@
-Classes reference
-=================
+Class reference
+===============
 
 .. toctree::
    :maxdepth: 1

+ 1 - 1
reference/shading_language.rst

@@ -314,7 +314,7 @@ CanvasItem (2D) - VertexShader
 | \| out float *POINT\_SIZE* \| Point Size (for points) \|
 | \| const mat4 *WORLD\_MATRIX* \| Object World Matrix \|
 | \| const mat4 *EXTRA\_MATRIX* \| Extra (user supplied) matrix via
-  `CanvasItem.draw\_set\_transform() <https://github.com/okamstudio/godot/wiki/class_canvasitem#draw_set_transform>`__.
+  :ref:`CanvasItem.draw_set_transform() <class_CanvasItem_draw_set_transform>`.
   Identity by default. \|
 | \| const mat4 *PROJECTION\_MATRIX* \| Projection Matrix (model coords
   to screen).\|

+ 1 - 1
tutorials/2d/canvas_layers.rst

@@ -19,7 +19,7 @@ parent, the children will be moved too.
   `Viewport <https://github.com/okamstudio/godot/wiki/class_viewport>`__,
   and will be displayed through it.
 | Viewport has a property "canvas\_transform"
-  (`Viewport.set\_canvas\_transform() <https://github.com/okamstudio/godot/wiki/class_viewport#set_canvas_transform)>`__,
+  :ref:`Viewport.set_canvas_transform() <class_Viewport_set_canvas_transform>`,
   which allows to transform all the CanvasItem hierarchy by a custom
   `Matrix32 <https://github.com/okamstudio/godot/wiki/class_matrix32>`__
   transform. Nodes such as

+ 1 - 1
tutorials/2d/custom_drawing_in_2d.rst

@@ -64,7 +64,7 @@ are cached and remembered, so further calls are unnecessary.
 
 If re-drawing is required because a state or something else changed,
 simply call
-`CanvasItem.update() <https://github.com/okamstudio/godot/wiki/class_canvasitem#update>`__
+:ref:`CanvasItem.update() <class_CanvasItem_update>`
 in that same node and a new \_draw() call will happen.
 
 Here is a little more complex example. A texture variable that will be

+ 5 - 5
tutorials/2d/custom_gui_controls.rst

@@ -25,7 +25,7 @@ Checking Control Size
 
 Unlike 2D nodes, "size" is very important with controls, as it helps to
 organize them in proper layouts. For this, the
-`Control.get\_size() <https://github.com/okamstudio/godot/wiki/class_control#get_size>`__
+:ref:`Control.get_size() <class_Control_get_size>`
 method is provided. Checking it during \_draw() is vital to ensure
 everything is kept in-bounds.
 
@@ -35,12 +35,12 @@ Checking Focus
 Some controls (such as buttons or text editors) might provide input
 focus for keyboard or joypad input. Examples of this are entering text
 or pressing a button. This is controlled with the
-`Control.set\_focus\_mode() <https://github.com/okamstudio/godot/wiki/class_control#set_focus_mode>`__
+:ref:`Control.set_focus_mode() <class_Control_set_focus_mode>`
 function. When drawing, and if the control supports input focus, it is
 always desired to show some sort of indicator (highight, box, etc) to
 indicate that this is the currently focused control. To check for this
 status, the
-`Control.has\_focus() <https://github.com/okamstudio/godot/wiki/class_control#has_focus>`__
+:ref:`Control.has_focus() <class_Control_has_focus>`
 exists. Example
 
 ::
@@ -64,7 +64,7 @@ the minimum size will make sure your custom control is not squished by
 the other controls in the container.
 
 To provide this callback, just override
-`Control.get\_minimum\_size() <https://github.com/okamstudio/godot/wiki/class_control#get_minimum_size>`__,
+:ref:`Control.get_minimum_size() <class_Control_get_minimum_size>`,
 for example:
 
 ::
@@ -96,7 +96,7 @@ when:
 -  The left button was pressed over this control (control always
    captures input until button si released)
 -  Control provides keyboard/joypad focus via
-   `Control.set\_focus\_mode <https://github.com/okamstudio/godot/wiki/class_control#set_focus_mode>`__.
+   :ref:`Control.set_focus_mode() <class_Control_set_focus_mode>`.
 
 This function is
 `Control.\_input\_event(event) <https://github.com/okamstudio/godot/wiki/class_control#_input_event>`__.

+ 1 - 1
tutorials/2d/gui_skinning.rst

@@ -84,7 +84,7 @@ children and grand children labels) will use that color.
 
 It is possible to override those options without using the theme
 directly and only for a specific control by using the override API in
-`Control <https://github.com/okamstudio/godot/wiki/class_control#add_color_override>`__:
+:ref:`Control.add_color_override() <class_Control_add_color_override>`:
 
 ::
 

+ 2 - 2
tutorials/2d/kinematic_character_2d.rst

@@ -196,8 +196,8 @@ Solution!
 The solution? This situation is solved by "sliding" by the collision
 normal. KinematicBody2D provides two useful functions:
 
--  `KinematicBody2D.is\_colliding() <https://github.com/okamstudio/godot/wiki/class_kinematicbody2d#is_colliding>`__
--  `KinematicBody2D.get\_collision\_normal() <https://github.com/okamstudio/godot/wiki/class_kinematicbody2d#get_collision_normal>`__
+-  :ref:`KinematicBody2D.is_colliding() <class_KinematicBody2D_is_colliding>`
+-  :ref:`KinematicBody2D.get_collision_normal() <class_KinematicBody2D_get_collision_normal>`
 
 So what we want to do is this:
 

+ 1 - 1
tutorials/2d/physics_introduction.rst

@@ -302,7 +302,7 @@ are in the scene. To get contacts reported, simply increase the amount
 of the "contacts reported" property from zero to a meaningful value
 (depending on how many you are expecting to get). The contacts can be
 later obtained via the
-`Physics2DDirectBodyState.get\_contact\_count() <https://github.com/okamstudio/godot/wiki/class_physics2ddirectbodystate#get_contact_count>`__
+:ref:`Physics2DDirectBodyState.get_contact_count() <class_Physics2DDirectBodyState_get_contact_count>`
 and related functions.
 
 Contact monitoring via signals is also available (signals similar to the

+ 3 - 3
tutorials/2d/viewport_and_canvas_transforms.rst

@@ -65,13 +65,13 @@ Obtaining each transform can be achieved with the following functions:
 
 | \|Type: \| Transform\|
 | \|CanvasItem \|
-  `CanvasItem.get\_global\_transform() <https://github.com/okamstudio/godot/wiki/class_canvasitem#get_global_transform>`__
+  :ref:`CanvasItem.get_global_transform() <class_CanvasItem_get_global_transform>`
   \|
 | \|CanvasLayer\|
-  `CanvasItem.get\_canvas\_transform() <https://github.com/okamstudio/godot/wiki/class_canvasitem#get_canvas_transform>`__
+  :ref:`CanvasItem.get_canvas_transform() <class_CanvasItem_get_canvas_transform>`
   \|
 | \|CanvasLayer+GlobalCanvas+Stretch \|
-  `CanvasItem.get\_viewport\_transform() <https://github.com/okamstudio/godot/wiki/class_canvasitem#get_viewport_transform>`__
+  :ref:`CanvasItem.get_viewport_transform() <class_CanvasItem_get_viewport_transform>`
   \|
 
 Finally then, to convert a CanvasItem local coordinates to screen

+ 1 - 1
tutorials/3d/introduction.rst

@@ -69,7 +69,7 @@ Generated Geometry
 It is possible to create custom geometry by using the
 `Mesh <https://github.com/okamstudio/godot/wiki/class_mesh>`__ resource
 directly, simply create your arrays and use the
-`Mesh.add\_surface <https://github.com/okamstudio/godot/wiki/class_mesh#add_surface>`__
+:ref:`Mesh.add_surface() <class_Mesh_add_surface>`
 function. A helper class is also available,
 `SurfaceTool <https://github.com/okamstudio/godot/wiki/class_surfacetool>`__,
 which provides a more straightforward API and helpers for indexing,

+ 1 - 1
tutorials/engine/internationalizing_a_game.rst

@@ -58,7 +58,7 @@ changing the language in the settings, the scenes (or at least the
 settings scene) will have to be re-loaded for new text to have effect.
 
 For code, the
-`Object.tr() <https://github.com/okamstudio/godot/wiki/class_object#tr>`__
+:ref:`Object.tr() <class_Object_tr>`
 function can be used. This will just look-up the text into the
 translations and convert it if found:
 

+ 1 - 1
tutorials/engine/pausing_the_game.rst

@@ -20,7 +20,7 @@ How Pausing Works
 -----------------
 
 To set pause mode, the pause state must be set. This is done by calling
-`SceneTree.set\_pause <https://github.com/okamstudio/godot/wiki/class_scenetree#set_pause>`__
+:ref:`SceneTree.set_pause() <class_SceneTree_set_pause>`
 with a "true" argument:
 
 ::

+ 1 - 1
tutorials/engine/viewports.rst

@@ -35,7 +35,7 @@ Viewports are also responsible of delivering properly adjusted and
 scaled input events to all it's children nodes. Both the root viewport
 and sub-viewports do this automatically, but render targets do not.
 Because of this, the user must do it manually via the
-`Viewport.input <https://github.com/okamstudio/godot/wiki/class_viewport#input>`__
+:ref:`Viewport.input() <class_Viewport_input>`
 function if needed.
 
 Listener

+ 1 - 1
tutorials/matrices_and_transforms.rst

@@ -206,7 +206,7 @@ the origin:
 | This will always work in global coordinates.
 | If instead, translation is desired in *local* coordinates of the
   matrix (towards where the *basis* is oriented), there is the
-  `Matrix32.translated <https://github.com/okamstudio/godot/wiki/class_matrix32#translated>`__
+  :ref:`Matrix32.translated() <class_Matrix32_translated>`
   method:
 
 ::

+ 1 - 1
tutorials/ray-casting.rst

@@ -82,7 +82,7 @@ Raycast Query
 ~~~~~~~~~~~~~
 
 For performing a 2D raycast query, the method
-`Physics2DDirectSpaceState.intersect\_ray() <https://github.com/okamstudio/godot/wiki/class_physics2ddirectspacestate#intersect_ray>`__
+:ref:`Physics2DDirectSpaceState.intersect_ray() <class_Physics2DDirectSpaceState_intersect_ray>`
 must be used, for example:
 
 ::

+ 5 - 5
tutorials/step_by_step/gui_tutorial.rst

@@ -48,12 +48,12 @@ Input and Drawing
 ~~~~~~~~~~~~~~~~~
 
 Controls receive input events by means of the
-`\_input\_event() <https://github.com/okamstudio/godot/wiki/class_control#_input_event>`__
+:ref:`Control._input_event() <class_Control__input_event>`
 callback. Only one control, the one in focus, will receive
 keyboard/joypad events (see
-`set\_focus\_mode() <https://github.com/okamstudio/godot/wiki/class_control#set_focus_mode>`__
+:ref:`Control.set_focus_mode() <class_Control_set_focus_mode>`
 and
-`grab\_focus() <https://github.com/okamstudio/godot/wiki/class_control#grab_focus>`__.
+:ref:`Control.grab_focus() <class_Control_grab_focus>`.
 
 Mouse Motion events are received by the control directly below the mouse
 pointer. When a control receives a mouse button pressed event, all
@@ -64,10 +64,10 @@ boundary.
 Like any class that inherits from
 `CanvasItem <https://github.com/okamstudio/godot/wiki/class_canvasitem>`__
 (Control does), a
-`\_draw() <https://github.com/okamstudio/godot/wiki/class_canvasitem#draw>`__
+:ref:`CanvasItem.draw() <class_CanvasItem_draw>`
 callback will be received at the begining and every time the control
 needs to be redrawn (programmer needs to call
-`update() <https://github.com/okamstudio/godot/wiki/class_canvasitem#update>`__
+:ref:`CanvasItem.update() <class_CanvasItem_update>`
 to enqueue the CanvasItem for redraw). If the control is not visible
 (yet aother CanvasItem property), the control does not receive any
 input.

+ 1 - 1
tutorials/step_by_step/resources.rst

@@ -108,7 +108,7 @@ are resources of type
 this means that the scene is packed inside a resource.
 
 To obtain an instance of the scene, the method
-`instance() <https://github.com/okamstudio/godot/wiki/class_packedscene#instance>`__
+:ref:`PackedScene.instance() <class_PackedScene_instance>`
 must be used.
 
 ::

+ 2 - 2
tutorials/step_by_step/scene_tree.rst

@@ -68,7 +68,7 @@ important uses:
 When a node is part of the Scene Tree, the
 `SceneTree <https://github.com/okamstudio/godot/wiki/class_scenemainloop>`__
 singleton can be obtained by simply calling
-`Node.get\_tree() <https://github.com/okamstudio/godot/wiki/class_node#get_tree>`__.
+:ref:`Node.get_tree() <class_Node_get_tree>`.
 
 Root Viewport
 -------------
@@ -138,7 +138,7 @@ Changing Current Scene
 
 After a scene is loaded, it is often desired to change this scene for
 another one. The simple way to do this to use the
-`SceneTree.change\_scene <https://github.com/okamstudio/godot/wiki/class_scenetree#change_scene>`__
+:ref:`SceneTree.change_scene() <class_SceneTree_change_scene>`
 function:
 
 ::

+ 1 - 1
tutorials/step_by_step/scripting.rst

@@ -163,7 +163,7 @@ interface, the connection will be done using code.
 
 For this, there is a function that is probably the one that Godot
 programmers will use the most, this is
-`get\_node() <https://github.com/okamstudio/godot/wiki/class_node#get_node>`__.
+:ref:`Node.get_node() <class_Node_get_node>`.
 This function uses paths to fetch nodes in the current tree or anywhere
 in the scene, relative to the node holding the script.
 

+ 8 - 9
tutorials/step_by_step/scripting_continued.rst

@@ -15,9 +15,9 @@ frame. There are two types of processing, idle processing and fixed
 processing.
 
 Idle processing is activated with the
-`Node.set\_process() <https://github.com/okamstudio/godot/wiki/class_node#set_process>`__
+:ref:`Node.set_process() <class_Node_set_process>`
 function. Once active, the
-`Node.\_process() <https://github.com/okamstudio/godot/wiki/class_node>`__
+:ref:`Node._process() <class_Node__process>`
 callback will be called every frame. Example:
 
 ::
@@ -70,7 +70,7 @@ tag scenes which are enemies.
 
 This way, if the player, sneaking into the secret base, is discovered,
 all enemies can be notified about the alarm sounding, by using
-`SceneTree.call\_group() <https://github.com/okamstudio/godot/wiki/class_scenemainloop#call_group>`__:
+:ref:`SceneTree.call_group() <class_SceneTree_call_group>`:
 
 ::
 
@@ -82,7 +82,7 @@ member of the group "guards".
 
 Optionally, it is possible to get the full list of "guards" nodes by
 calling
-`SceneTree.get\_nodes\_in\_group() <https://github.com/okamstudio/godot/wiki/class_scenemainloop#get_nodes_in_group>`__:
+:ref:`SceneTree.get_nodes_in_group() <class_SceneTree_get_nodes_in_group>`:
 
 ::
 
@@ -99,7 +99,7 @@ Godot has a system of notifications. This is usually not needed to be
 used from scripting, as it's too low level and virtual functions are
 provided for most of them. It's just good to know they exists. Simply
 add a
-`Object.\_notification() <https://github.com/okamstudio/godot/wiki/class_object#_notification>`__
+:ref:`Object._notification() <class_Object__notification>`
 function in your script:
 
 ::
@@ -111,8 +111,7 @@ function in your script:
             var delta = get_process_time()
             print("This is the same as overriding _process()...")
 
-The documentation of each class in the `class
-list <https://github.com/okamstudio/godot/wiki/class_class_list>`__
+The documentation of each class in the :ref:`Class Reference <toc-class-ref>`
 shows the notifications it can receive. However, again, for most cases
 script provides simpler overrideable functions.
 
@@ -176,7 +175,7 @@ calling a function. This will result in crashing the game. Running Godot
 in the debugger often will catch this case and warn you about it.
 
 The safest way to delete a node is by using
-`queue\_free() <https://github.com/okamstudio/godot/wiki/class_node#queue_free>`__
+:ref:`Node.queue_free() <class_Node_queue_free>`
 instead. This erases the node during idle, safely.
 
 ::
@@ -205,7 +204,7 @@ But 'scene' is still not a node containing subnodes. It's packed in a
 special resource called
 `PackedScene <https://github.com/okamstudio/godot/wiki/class_packedscene>`__.
 To create the actual node, the function
-`PackedScene.instance() <https://github.com/okamstudio/godot/wiki/class_packedscene#instance>`__
+:ref:`PackedScene.instance() <class_PackedScene_instance>`
 must be called. This will return the tree of nodes that can be added to
 the active scene:
 

+ 2 - 2
tutorials/step_by_step/singletons_autoload.rst

@@ -58,7 +58,7 @@ Custom Scene Switcher
 
 This short tutorial will explain how to make a scene switcher by using
 autoload. For simple scene switching, the
-`SceneTree.change\_scene <https://github.com/okamstudio/godot/wiki/class_scenetree#change_scene>`__
+:ref:`SceneTree.change_scene() <class_SceneTree_change_scene>`
 method suffices (described in :ref:`doc_scene_tree`), so this method is for
 more complex behaviors when switching scenes.
 
@@ -149,7 +149,7 @@ current scene and replace it by the requested one.
 As mentioned in the comments above, we really want to avoid the
 situation of having the current scene being deleted while being used
 (code from functions of it being run), so using
-`Object.call\_deferred <https://github.com/okamstudio/godot/wiki/class_object#call_deferred>`__
+:ref:`Object.call_deferred() <class_Object_call_deferred>`
 is desired at this point. The result is that execution of the commands
 in the second function will happen at an immediate later time when no
 code from the current scene is running.