Mobile::moveFinger: Difference between revisions
No edit summary |
MrPancakers (talk | contribs) (Added example, added direction info, cleaned up) |
||
| Line 1: | Line 1: | ||
{{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== | ||
< | <pre>mp.game.mobile.moveFinger(direction);</pre> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''direction:''' | *'''direction:''' {{RageType|Int}} | ||
===Return value=== | ===Return value=== | ||
*'''Undefined''' | *'''Undefined''' | ||
==Example== | ==Example== | ||
< | {{ClientsideCode| | ||
// | <pre> | ||
</ | 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]] | ||
Latest revision as of 23:43, 22 January 2019
Client-Side Function
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
- mp.game.mobile.cellCamActivate
- mp.game.mobile.createMobilePhone
- mp.game.mobile.getMobilePhonePosition
- mp.game.mobile.getMobilePhoneRenderId
- mp.game.mobile.getMobilePhoneRotation
- mp.game.mobile.moveFinger
- mp.game.mobile.scriptIsMovingMobilePhoneOffscreen
- mp.game.mobile.setMobilePhonePosition
- mp.game.mobile.setMobilePhoneRotation
- mp.game.mobile.setMobilePhoneScale
- mp.game.mobile.setPhoneLean