Note: These blocks only work on iOS and Android. They have no effect on other platforms (or return 0/-1/useless values).
Returns the current values for the accelerometer.
Portrait Orientation
Name | Description |
---|---|
X (Positive) | Right |
X (Negative) | Left |
Y (Positive) | Up |
Y (Negative) | Down |
Landscape Orientation
Name | Description |
---|---|
X (Positive) | Up |
X (Negative) | Down |
Y (Positive) | Left |
Y (Negative) | Right |
Input.accelX
Input.accelY
Input.accelZ
Returns true
if the user has swiped [up/down/left/right]. A swipe is defined as touching the screen, sliding the finger and then releasing.
Input.swipedUp
Input.swipedDown
Input.swipedLeft
Input.swipedRight
We recommend using a swipe event instead of a swipe block. It's easier to work with.
Immediately shows or hides the virtual keyboard. Use mobile keyboard events to track what's been typed.
hideKeyboard();
showKeyboard();
Imagine that the keyboard is inputting into an invisible text field. This sets the text that's in that text field.
setKeyboardText([TEXT]);
Imagine that the keyboard is inputting into an invisible text field. This clears out the text that's in that text field.
setKeyboardText("");
Vibrates the device for the given number of seconds. On some devices, vibration duration cannot be controlled.
vibrate([NUMBER]);