Difference between revisions of "Joystick:getID"
(Created page) |
m |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.9.0]]|090|type=function}} | {{newin|[[0.9.0]]|090|type=function}} | ||
− | Gets the joystick's unique | + | Gets the joystick's unique identifier. The identifier will remain the same for the life of the game, even when the Joystick is disconnected and reconnected, but it '''will''' change when the game is re-launched. |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | id = Joystick:getID( ) | + | id, instanceid = Joystick:getID( ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
None. | None. | ||
=== Returns === | === Returns === | ||
− | {{param|number|id|The Joystick's unique identifier.}} | + | {{param|number|id|The Joystick's unique identifier. Remains the same as long as the game is running.}} |
+ | {{param|number|instanceid (nil)|Unique instance identifier. Changes every time the Joystick is reconnected. nil if the Joystick is not connected.}} | ||
== See Also == | == See Also == | ||
* [[parent::Joystick]] | * [[parent::Joystick]] | ||
+ | * [[Joystick:isConnected]] | ||
* [[Joystick:getGUID]] | * [[Joystick:getGUID]] | ||
− | |||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=Gets the joystick's unique | + | {{#set:Description=Gets the joystick's unique identifier.}} |
== Other Languages == | == Other Languages == | ||
{{i18n|Joystick:getID}} | {{i18n|Joystick:getID}} |
Latest revision as of 02:46, 31 August 2013
Available since LÖVE 0.9.0 |
This function is not supported in earlier versions. |
Gets the joystick's unique identifier. The identifier will remain the same for the life of the game, even when the Joystick is disconnected and reconnected, but it will change when the game is re-launched.
Function
Synopsis
id, instanceid = Joystick:getID( )
Arguments
None.
Returns
number id
- The Joystick's unique identifier. Remains the same as long as the game is running.
number instanceid (nil)
- Unique instance identifier. Changes every time the Joystick is reconnected. nil if the Joystick is not connected.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info