Difference between revisions of "love.joystick.open"

m (1 revision: Importing from potato (again).)
m (Added since 0.5.0)
 
(14 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 
+
{{newinoldin|[[0.5.0]]|050|[[0.9.0]]|090|type=function}}
Opens up a joystick to be used.
+
Opens up a joystick to be used, i.e. makes it ready to use. By default joysticks that are available at the start of your game will be opened.
 +
{{notice|Unlike conventional Lua indexes, joysticks begin counting from 0 in LÖVE [[0.7.2]] and below. To to open the first joystick, you would use <tt>love.joystick.open(0)</tt>. This is not the case in LÖVE [[0.8.0]] and later.}}
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.joystick.open( joystick )
+
open = love.joystick.open( joystick )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|joystick|The joystick to be checked}}
+
{{param|number|joystick|The joystick to be opened}}
 
=== Returns ===
 
=== Returns ===
Nothing.
+
{{param|boolean|open|True if the joystick has been successfully opened or false on failure.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.joystick]]
 
* [[parent::love.joystick]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Opens up a joystick to be used.}}
 
{{#set:Description=Opens up a joystick to be used.}}
 +
{{#set:Since=000}}
 +
== Other Languages ==
 +
{{i18n|love.joystick.open}}

Latest revision as of 09:15, 28 December 2019

Available since LÖVE 0.5.0 and removed in LÖVE 0.9.0
This function is not supported in earlier or later versions.

Opens up a joystick to be used, i.e. makes it ready to use. By default joysticks that are available at the start of your game will be opened.

O.png Unlike conventional Lua indexes, joysticks begin counting from 0 in LÖVE 0.7.2 and below. To to open the first joystick, you would use love.joystick.open(0). This is not the case in LÖVE 0.8.0 and later.  


Function

Synopsis

open = love.joystick.open( joystick )

Arguments

number joystick
The joystick to be opened

Returns

boolean open
True if the joystick has been successfully opened or false on failure.

See Also


Other Languages