Difference between revisions of "love.joystick.open"

(Corrected return value.)
Line 5: Line 5:
 
=== 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 opened}}
 
{{param|number|joystick|The joystick to be opened}}
 
=== Returns ===
 
=== Returns ===
Nothing.
+
{{param|boolean|open|True if the joystick has been sucessfully opened or false on failure.}}
 
== See Also ==
 
== See Also ==
 
* [[parent::love.joystick]]
 
* [[parent::love.joystick]]

Revision as of 18:29, 10 March 2012

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.

NOTE: Unlike conventional Lua indexes, joysticks begin counting from 0. To to open the first joystick, you would use love.joystick.open(0). This is being changed to begin from one in the upcoming LOVE 0.8.0 stated [here].

Function

Synopsis

open = love.joystick.open( joystick )

Arguments

number joystick
The joystick to be opened

Returns

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

See Also


Other Languages