Difference between revisions of "Joystick:getPlayerIndex"

(Created page)
 
m (Synopsis: typo)
 
Line 7: Line 7:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
index = Joystick:setPlayerIndex( )
+
index = Joystick:getPlayerIndex( )
 
</source>
 
</source>
 +
 
=== Arguments ===
 
=== Arguments ===
 
None.
 
None.

Latest revision as of 17:06, 31 March 2024

Available since LÖVE 12.0
This function is not supported in earlier versions.

Gets the player index of this Joystick. This corresponds to an indicator light on many common gamepads.


Note that this is independent from the array index of this Joystick in the table returned by love.joystick.getJoysticks.

Function

Synopsis

index = Joystick:getPlayerIndex( )

Arguments

None.

Returns

number index
The 1-based player index being used for this Joystick, or -1 if the player index has not been set or cannot be determined.

See Also

Other Languages