Skip to content

Commit

Permalink
Merge pull request #30096 from akien-mga/doc-misc-updates
Browse files Browse the repository at this point in the history
doc: Proofread and complete various nodes
  • Loading branch information
akien-mga authored Jun 27, 2019
2 parents eaaff9d + 867dda1 commit 755b589
Show file tree
Hide file tree
Showing 24 changed files with 301 additions and 152 deletions.
8 changes: 1 addition & 7 deletions core/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ void Object::clear_internal_resource_paths() {
void Object::_bind_methods() {

ClassDB::bind_method(D_METHOD("get_class"), &Object::get_class);
ClassDB::bind_method(D_METHOD("is_class", "type"), &Object::is_class);
ClassDB::bind_method(D_METHOD("is_class", "class"), &Object::is_class);
ClassDB::bind_method(D_METHOD("set", "property", "value"), &Object::_set_bind);
ClassDB::bind_method(D_METHOD("get", "property"), &Object::_get_bind);
ClassDB::bind_method(D_METHOD("set_indexed", "property", "value"), &Object::_set_indexed_bind);
Expand All @@ -1704,14 +1704,8 @@ void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_meta", "name"), &Object::has_meta);
ClassDB::bind_method(D_METHOD("get_meta_list"), &Object::_get_meta_list_bind);

//todo reimplement this per language so all 5 arguments can be called

//ClassDB::bind_method(D_METHOD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()));
//ClassDB::bind_method(D_METHOD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()));

ClassDB::bind_method(D_METHOD("add_user_signal", "signal", "arguments"), &Object::_add_user_signal, DEFVAL(Array()));
ClassDB::bind_method(D_METHOD("has_user_signal", "signal"), &Object::_has_user_signal);
//ClassDB::bind_method(D_METHOD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array()));

{
MethodInfo mi;
Expand Down
6 changes: 3 additions & 3 deletions core/os/main_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void MainLoop::_bind_methods() {
BIND_VMETHOD(MethodInfo("_input_event", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
BIND_VMETHOD(MethodInfo("_input_text", PropertyInfo(Variant::STRING, "text")));
BIND_VMETHOD(MethodInfo("_initialize"));
BIND_VMETHOD(MethodInfo("_iteration", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo("_idle", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen")));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_iteration", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo(Variant::BOOL, "_idle", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo("_drop_files", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "from_screen")));
BIND_VMETHOD(MethodInfo("_finalize"));

BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER);
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/ARVRAnchor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</brief_description>
<description>
The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised.
This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognized.
Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
</description>
<tutorials>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/ConeTwistJoint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Swing is rotation from side to side, around the axis perpendicular to the twist axis.
The swing span defines, how much rotation will not get corrected allong the swing axis.
Could be defined as looseness in the [ConeTwistJoint].
If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code].
If below 0.05, this behavior is locked. Default value: [code]PI/4[/code].
</member>
<member name="twist_span" type="float" setter="_set_twist_span" getter="_get_twist_span">
Twist is the rotation around the twist axis, this value defined how far the joint can twist.
Expand All @@ -39,7 +39,7 @@
Swing is rotation from side to side, around the axis perpendicular to the twist axis.
The swing span defines, how much rotation will not get corrected allong the swing axis.
Could be defined as looseness in the [ConeTwistJoint].
If below 0.05, this behaviour is locked. Default value: [code]PI/4[/code].
If below 0.05, this behavior is locked. Default value: [code]PI/4[/code].
</constant>
<constant name="PARAM_TWIST_SPAN" value="1" enum="Param">
Twist is the rotation around the twist axis, this value defined how far the joint can twist.
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Directory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<argument index="1" name="skip_hidden" type="bool" default="false">
</argument>
<description>
Initialise the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end].
Initialize the stream used to list all files and directories using the [method get_next] function, closing the current opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end].
If you pass [code]skip_navigational[/code], then [code].[/code] and [code]..[/code] would be filtered out.
If you pass [code]skip_hidden[/code], then hidden files would be filtered out.
</description>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Light2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</members>
<constants>
<constant name="MODE_ADD" value="0" enum="Mode">
Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behaviour of a light.
Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light.
</constant>
<constant name="MODE_SUB" value="1" enum="Mode">
Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect.
Expand Down
81 changes: 75 additions & 6 deletions doc/classes/MainLoop.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MainLoop" inherits="Object" category="Core" version="3.2">
<brief_description>
Main loop is the abstract main loop base class.
Abstract base class for the game's main loop.
</brief_description>
<description>
Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a [MainLoop] has to be provided to OS, else the application will exit. This happens automatically (and a [SceneTree] is created), unless a main [Script] is supplied, which may or not create and return a [MainLoop].
[MainLoop] is the abstract base class for a Godot project's game loop. It in inherited by [SceneTree], which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own [MainLoop] subclass instead of the scene tree.
Upon application start, a [MainLoop] implementation has to be provided to the OS, or the application will exit. This happens automatically (and a [SceneTree] is created) unless a main [Script] is provided from the command line (with e.g. [code]godot -s my_loop.gd[/code], which should then be a [MainLoop] implementation.
Here is an example script implementing a simple [MainLoop]:
[codeblock]
extends MainLoop

var time_elapsed = 0
var keys_typed = []
var quit = false

func _initialize():
print("Initialized:")
print(" Starting time: %s" % str(time_elapsed))

func _idle(delta):
time_elapsed += delta
# Return true to end the main loop
return quit

func _input_event(event):
# Record keys
if event is InputEventKey and event.pressed and !event.echo:
keys_typed.append(OS.get_scancode_string(event.scancode))
# Quit on Escape press
if event.scancode == KEY_ESCAPE:
quit = true
# Quit on any mouse click
if event is InputEventMouseButton:
quit = true

func _finalize():
print("Finalized:")
print(" End time: %s" % str(time_elapsed))
print(" Keys typed: %s" % var2str(keys_typed))
[/codeblock]
</description>
<tutorials>
</tutorials>
Expand All @@ -14,9 +48,10 @@
</return>
<argument index="0" name="files" type="PoolStringArray">
</argument>
<argument index="1" name="screen" type="int">
<argument index="1" name="from_screen" type="int">
</argument>
<description>
Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated.
</description>
</method>
<method name="_finalize" qualifiers="virtual">
Expand All @@ -27,12 +62,13 @@
</description>
</method>
<method name="_idle" qualifiers="virtual">
<return type="void">
<return type="bool">
</return>
<argument index="0" name="delta" type="float">
</argument>
<description>
Called each idle frame with time since last call as an only argument.
Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to [method Node._process].
If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
<method name="_initialize" qualifiers="virtual">
Expand All @@ -48,6 +84,7 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
Called whenever an [InputEvent] is received by the main loop.
</description>
</method>
<method name="_input_text" qualifiers="virtual">
Expand All @@ -56,20 +93,24 @@
<argument index="0" name="text" type="String">
</argument>
<description>
Deprecated callback, does not do anything. Use [method _input_event] to parse text input. Will be removed in Godot 4.0.
</description>
</method>
<method name="_iteration" qualifiers="virtual">
<return type="void">
<return type="bool">
</return>
<argument index="0" name="delta" type="float">
</argument>
<description>
Called each physics frame with the time since the last physics frame as argument (in seconds). Equivalent to [method Node._physics_process].
If implemented, the method must return a boolean value. [code]true[/code] ends the main loop, while [code]false[/code] lets it proceed to the next frame.
</description>
</method>
<method name="finish">
<return type="void">
</return>
<description>
Should not be called manually, override [method _finalize] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="idle">
Expand All @@ -78,12 +119,14 @@
<argument index="0" name="delta" type="float">
</argument>
<description>
Should not be called manually, override [method _idle] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="init">
<return type="void">
</return>
<description>
Should not be called manually, override [method _initialize] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="input_event">
Expand All @@ -92,6 +135,7 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
Should not be called manually, override [method _input_event] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="input_text">
Expand All @@ -100,6 +144,7 @@
<argument index="0" name="text" type="String">
</argument>
<description>
Should not be called manually, override [method _input_text] instead. Will be removed in Godot 4.0.
</description>
</method>
<method name="iteration">
Expand All @@ -108,33 +153,57 @@
<argument index="0" name="delta" type="float">
</argument>
<description>
Should not be called manually, override [method _iteration] instead. Will be removed in Godot 4.0.
</description>
</method>
</methods>
<constants>
<constant name="NOTIFICATION_WM_MOUSE_ENTER" value="1002">
Notification received from the OS when the mouse enters the game window.
Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_MOUSE_EXIT" value="1003">
Notification received from the OS when the mouse leaves the game window.
Implemented on desktop and web platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_IN" value="1004">
Notification received from the OS when the game window is focused.
Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_FOCUS_OUT" value="1005">
Notification received from the OS when the game window is unfocused.
Implemented on all platforms.
</constant>
<constant name="NOTIFICATION_WM_QUIT_REQUEST" value="1006">
Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4).
Implemented on desktop platforms.
</constant>
<constant name="NOTIFICATION_WM_GO_BACK_REQUEST" value="1007">
Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android).
Specific to the Android platform.
</constant>
<constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="1008">
Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus).
No supported platforms currently send this notification.
</constant>
<constant name="NOTIFICATION_OS_MEMORY_WARNING" value="1009">
Notification received from the OS when the application is exceeding its allocated memory.
Specific to the iOS platform.
</constant>
<constant name="NOTIFICATION_TRANSLATION_CHANGED" value="1010">
Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr].
</constant>
<constant name="NOTIFICATION_WM_ABOUT" value="1011">
Notification received from the OS when a request for "About" information is sent.
Specific to the macOS platform.
</constant>
<constant name="NOTIFICATION_CRASH" value="1012">
Notification received from Godot's crash handler when the engine is about to crash.
Implemented on desktop platforms if the crash handler is enabled.
</constant>
<constant name="NOTIFICATION_OS_IME_UPDATE" value="1013">
Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string).
Specific to the macOS platform.
</constant>
</constants>
</class>
Loading

0 comments on commit 755b589

Please sign in to comment.