变量
ProtoPie支持变量功能。变量值的属性有文本、数字、颜色三种。通过使用"赋值"反应动作让变量的值发生变化,然后再通过"侦查"触发动作检测到变量发生了变化,只要有变化发生就会触发设定好的反应动作。另外,在反应动作的属性设置里,除了直接输入数值,还可以输入表达式,而表达式里面可以套用变量。也就是说现在调整动作属性变化的方式有两种,一种是直接输入数值,一种是通过含有变量的表达式。
适用于所有场景的变量
该变量可以在一个文件内的所用场景中使用。一般在制作跨场景的交互逻辑时使用。比如在场景1里如果"适用于所有场景"的变量发生了变化,那么可以影响场景2里面的交互也发生变化。
仅适用于当前场景的变量
该变量仅对当前场景起作用。在场景1里面制作的变量无论怎么变化都不会影响到场景B。为各场景设置独立变量时使用。

变量种类
变量的种类有三个:文本、数字、颜色。在设定变量的时候先需要选择一个种类,之后在用到这个变量时,系统就会按照相应的种类去处理。
文本
只可以设定文本类的值。即使输入的是数字,系统也会把数字按照文本去处理。
数字
只可以设定数字类的值。如果输入是文本,则会发生错误。
颜色
只可以设定#FFFFFF类的颜色值。如果输入其他格式,则会发生错误。

显示变量
在画板和预览窗可以显示变量的当前值。这个功能可以帮助在制作过程中观察变量是否按照预想的方式在变化。

预定义变量
预定义变量指的是ProtoPie自己为用户已经设定好的一些变量,用户可以直接调用。比如识别鼠标当前坐标的变量,或者识别键盘高度的变量等
$mouseX
The x-coordinate of a mouse pointer$mouseY
The y-coordinate of a mouse pointer.$touchX
The x-coordinate of a point where a touch is registered.$touchY
The y-coordinate of a point where a touch is registered.$touchVelocity
The velocity of a touch using a finger or mouse that is in movement.$touchVelocityX
The x-component of the velocity of a touch using a finger or mouse that is in movement.$touchVelocityY
The y-component of the velocity of a touch using a finger or mouse that is in movement.$touchPointerCount
The number of fingers that are touching the screen.$keyboardHeight
The height of a native keyboard on a smart device when it is visible.$deviceOS
The operating system of the device on which the prototype is running.$pi
Pi (3.141592).$time
Time after running Pie (seconds). If you want to figure out the time passed since a certain event, you should assign the time when the event occurs to a variable and deduct it from the $time value.$voiceTranscript
The incoming speech whenever speech recognition is enabled.