Mobile::moveFinger: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
(Added example, added direction info, cleaned up)
 
Line 1: Line 1:
For move the finger of player, the value of int goes 1 at 5.
{{ClientsideJsFunction}}
Moves the player's finger while holding the phone.
 
Movements:
* 1 - Swipe Up
* 2 - Swipe Down
* 3 - Swipe Left
* 4 - Swipe Right
* 5 - Button Press
 
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">mp.game.mobile.moveFinger(direction);</syntaxhighlight>
<pre>mp.game.mobile.moveFinger(direction);</pre>
 
=== Required Arguments ===
=== Required Arguments ===
*'''direction:''' int
*'''direction:''' {{RageType|Int}}
 
===Return value===
===Return value===
*'''Undefined'''
*'''Undefined'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
{{ClientsideCode|
// todo
<pre>
</syntaxhighlight>
mp.keys.bind(0x26, true, function() {  // Up Arrow
    mp.game.mobile.moveFinger(1);
});
 
mp.keys.bind(0x28, true, function() {  // Down Arrow
    mp.game.mobile.moveFinger(2);
});
 
mp.keys.bind(0x27, true, function() {  // Right Arrow
    mp.game.mobile.moveFinger(4);
});
 
mp.keys.bind(0x25, true, function() {  // Left Arrow
    mp.game.mobile.moveFinger(3);
});
 
mp.keys.bind(0x0D, true, function() {  // Enter
    mp.game.mobile.moveFinger(5);
});
</pre>
}}
==See also==
==See also==
{{Mobile_s_function_c}}
{{Mobile_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Mobile API]]
[[Category:Mobile API]]
[[Category:TODO: Example]]

Latest revision as of 23:43, 22 January 2019

Client-Side
Function

 JavaScript



Moves the player's finger while holding the phone.

Movements:

  • 1 - Swipe Up
  • 2 - Swipe Down
  • 3 - Swipe Left
  • 4 - Swipe Right
  • 5 - Button Press


Syntax

mp.game.mobile.moveFinger(direction);

Required Arguments

  • direction: Int

Return value

  • Undefined

Example

Client-Side
mp.keys.bind(0x26, true, function() {   // Up Arrow
    mp.game.mobile.moveFinger(1);
});

mp.keys.bind(0x28, true, function() {   // Down Arrow
    mp.game.mobile.moveFinger(2);
});

mp.keys.bind(0x27, true, function() {   // Right Arrow
    mp.game.mobile.moveFinger(4);
});

mp.keys.bind(0x25, true, function() {   // Left Arrow
    mp.game.mobile.moveFinger(3);
});

mp.keys.bind(0x0D, true, function() {   // Enter
    mp.game.mobile.moveFinger(5);
});

See also