Input Documentation

Input Documentation
This commit is contained in:
CowThing 2016-05-03 14:42:41 -04:00
parent 5b039245b9
commit f6ae5e41de
1 changed files with 16 additions and 0 deletions

View File

@ -15031,8 +15031,10 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</class> </class>
<class name="Input" inherits="Object" category="Core"> <class name="Input" inherits="Object" category="Core">
<brief_description> <brief_description>
A Singleton that deals with inputs.
</brief_description> </brief_description>
<description> <description>
A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joysticks, and input actions.
</description> </description>
<methods> <methods>
<method name="is_key_pressed"> <method name="is_key_pressed">
@ -15041,6 +15043,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="scancode" type="int"> <argument index="0" name="scancode" type="int">
</argument> </argument>
<description> <description>
Returns true or false depending on whether the key is pressed or not. You can pass KEY_*, which are pre-defined constants listed in [@Global Scope].
</description> </description>
</method> </method>
<method name="is_mouse_button_pressed"> <method name="is_mouse_button_pressed">
@ -15069,6 +15072,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="0" name="action" type="String"> <argument index="0" name="action" type="String">
</argument> </argument>
<description> <description>
Returns true or false depending on whether the action event is pressed. Actions and their events can be set in the Project Settings / Input Map tab. Or be set with [InputMap].
</description> </description>
</method> </method>
<method name="add_joy_mapping"> <method name="add_joy_mapping">
@ -15129,48 +15133,56 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<return type="Vector3"> <return type="Vector3">
</return> </return>
<description> <description>
If the device has an accelerometer, this will return the movement.
</description> </description>
</method> </method>
<method name="get_mouse_speed" qualifiers="const"> <method name="get_mouse_speed" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the mouse speed.
</description> </description>
</method> </method>
<method name="get_mouse_button_mask" qualifiers="const"> <method name="get_mouse_button_mask" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time the bits are added together.
</description> </description>
</method> </method>
<method name="set_mouse_mode"> <method name="set_mouse_mode">
<argument index="0" name="mode" type="int"> <argument index="0" name="mode" type="int">
</argument> </argument>
<description> <description>
Set the mouse mode. See the constants for more information.
</description> </description>
</method> </method>
<method name="get_mouse_mode" qualifiers="const"> <method name="get_mouse_mode" qualifiers="const">
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Return the mouse mode. See the constants for more information.
</description> </description>
</method> </method>
<method name="warp_mouse_pos"> <method name="warp_mouse_pos">
<argument index="0" name="to" type="Vector2"> <argument index="0" name="to" type="Vector2">
</argument> </argument>
<description> <description>
Sets the mouse position to the specified vector.
</description> </description>
</method> </method>
<method name="action_press"> <method name="action_press">
<argument index="0" name="action" type="String"> <argument index="0" name="action" type="String">
</argument> </argument>
<description> <description>
This will simulate pressing the specificed action.
</description> </description>
</method> </method>
<method name="action_release"> <method name="action_release">
<argument index="0" name="action" type="String"> <argument index="0" name="action" type="String">
</argument> </argument>
<description> <description>
If the specified action is already pressed, this will release it.
</description> </description>
</method> </method>
<method name="set_custom_mouse_cursor"> <method name="set_custom_mouse_cursor">
@ -15179,6 +15191,7 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
<argument index="1" name="hotspot" type="Vector2" default="Vector2(0,0)"> <argument index="1" name="hotspot" type="Vector2" default="Vector2(0,0)">
</argument> </argument>
<description> <description>
Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified.
</description> </description>
</method> </method>
</methods> </methods>
@ -15195,10 +15208,13 @@ Example: (content-length:12), (Content-Type:application/json; charset=UTF-8)
</signals> </signals>
<constants> <constants>
<constant name="MOUSE_MODE_VISIBLE" value="0"> <constant name="MOUSE_MODE_VISIBLE" value="0">
Makes the mouse cursor visible if it is hidden.
</constant> </constant>
<constant name="MOUSE_MODE_HIDDEN" value="1"> <constant name="MOUSE_MODE_HIDDEN" value="1">
Makes the mouse cursor hidden if it is visible.
</constant> </constant>
<constant name="MOUSE_MODE_CAPTURED" value="2"> <constant name="MOUSE_MODE_CAPTURED" value="2">
Captures the mouse. The mouse will be hidden and unable to leave the game window. But it will still register movement and mouse button presses.
</constant> </constant>
</constants> </constants>
</class> </class>