MenuToggle Menu
Predefined Variables
Predefined variables are a set of variables that are always accessible in your prototypes. The values they store update automatically.
For example, the value of $mouseX will always change automatically, depending on wherever the cursor finds itself.
Learn more about using variables.
$mouseX
x-coordinate of the cursor.$mouseY
y-coordinate of the cursor.$touchX
x-coordinate of where a touch is registered.$touchY
y-coordinate of where a touch is registered.$touchVelocity
Velocity of a touch using a finger or mouse that is in movement.$touchVelocityX
x-component of the velocity of a touch using a finger or mouse that is in movement.$touchVelocityY
y-component of the velocity of a touch using a finger or mouse that is in movement.$touchPointerCount
Number of fingers touching the screen.$keyboardHeight
Height of a native keyboard on a smart device when it is visible. Learn more about the input layer.$deviceOS
Operating system of the device the prototype is running on.$pi
Pi (3.141592).$time
Time (seconds) passed since the prototype started. If you want to know the time passed since a certain event, assign the time when the event occurs to a variable and deduct it from $time.$voiceTranscript
Incoming speech whenever listening to voice commands is enabled. Learn more about voice prototyping.$deviceHeight
displays the height of the device.$deviceWidth
displays the width of the device.The device width and device height of a device represent its screen size (resolution size), not the viewport size. For example, an iPhone 14 Pro has a resolution of 390x844 @3x, so its device width x device height is 1170x2532 (i.e., (390x3)x (844x3)).
Therefore, the preset size and the device size are not related. If you run a pie that is preset to iPhone 13 on an iPhone 14, the device size of the iPhone 14 will be displayed. Check out this example to learn more.
$qrValue
returns the value stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.$qrHeight
returns the height stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.$qrWidth
returns the width stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.$qrX
returns the x-coordinate stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.$qrY
returns the y-coordinate stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.$barcodeValue
returns the value stored in a barcode after it has been scanned using the QR & Barcode Scanner.$barcodeHeight
returns the height stored in a barcode after it has been scanned using the QR & Barcode Scanner.$barcodeWidth
returns the width stored in a barcode after it has been scanned using the QR & Barcode Scanner.$barcodeX
returns the x-coordinate stored in a barcode after it has been scanned using the QR & Barcode Scanner.$barcodeY
returns the y-coordinate stored in a barcode after it has been scanned using the QR & Barcode Scanner.