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.

  • $mouseXx-coordinate of the cursor.
  • $mouseYy-coordinate of the cursor.
  • $touchXx-coordinate of where a touch is registered.
  • $touchYy-coordinate of where a touch is registered.
  • $touchVelocityVelocity of a touch using a finger or mouse that is in movement.
  • $touchVelocityXx-component of the velocity of a touch using a finger or mouse that is in movement.
  • $touchVelocityYy-component of the velocity of a touch using a finger or mouse that is in movement.
  • $touchPointerCountNumber of fingers touching the screen.
  • $keyboardHeightHeight of a native keyboard on a smart device when it is visible. Learn more about the input layer.
  • $deviceOSOperating system of the device the prototype is running on.
  • $piPi (3.141592).
  • $timeTime (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.
  • $voiceTranscriptIncoming speech whenever listening to voice commands is enabled. Learn more about voice prototyping.
  • $deviceHeightdisplays the height of the device.
  • $deviceWidthdisplays 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.

  • $qrValuereturns the value stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.
  • $qrHeightreturns the height stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.
  • $qrWidthreturns the width stored in a QR code after it has been scanned using the QR & Barcode Scanner. Learn more about the QR Code Scanner.
  • $qrXreturns 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.
  • $qrYreturns 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.
  • $barcodeValuereturns the value stored in a barcode after it has been scanned using the QR & Barcode Scanner.
  • $barcodeHeightreturns the height stored in a barcode after it has been scanned using the QR & Barcode Scanner.
  • $barcodeWidthreturns the width stored in a barcode after it has been scanned using the QR & Barcode Scanner.
  • $barcodeXreturns the x-coordinate stored in a barcode after it has been scanned using the QR & Barcode Scanner.
  • $barcodeYreturns the y-coordinate stored in a barcode after it has been scanned using the QR & Barcode Scanner.
Back To Top