Remember state (on or off). Switch patches are like light switches. They can be off or on and are useful when building simple two-state interactions (showing and hiding comments in a popover, for example).
记住 On 或 Off 两个状态。Switch 模块跟灯的开关一样。开关可以被打开或关闭,用于需要在两个状态之间切换(如,隐藏或显示评论。)
The Switch patches Flip port is useful when one interaction type is used to control the switch. For example, if repeatedly tapping a photo zooms it between a large and small size, the Switch patch can be used to hold the current zoom state (in or out). Simply connect the Switch patches Flip input port to the Tap output of the photos Interaction patch.
用来控制 Switch 模块的交互模块连接到 Flip 接口。例如点击图片放大或缩小,Switch 模块可以保持缩放的两个状态(进或出)。将图片图层的 Interaction 模块的 Tap 输出口连接到 Switch 模块的 Flip 输入口就可以实现。
The Switch patches On and Off ports are useful when different types of interactions control the switch. For example, in a compose window, a Compose button might turn on the switch and the Cancel and Done buttons might turn off the switch.
See State Basics for more information.
On 和 Off 接口用于不同类型的交互控制同一个开关。例如在一个编辑弹窗中,可能编辑按钮打开开关,取消和确定按钮关闭开关。
更多信息请阅读《Basics 基础 - States 状态》。
输入口
Flip
A pulse that flips the state of the switch (from on to off, or vice versa).
翻转开关状态的脉冲(开、关之间循环切换)。一般连接交互模块。
Turn On 打开
A pulse that turns the switch on. If the switch is already on, the pulse has no effect.
打开开关的脉冲。如果开关已经是打开状态则无效。一般连接交互模块。
Turn Off 关闭
A pulse that turns the switch off. If the switch is already off, the pulse has no effect.
关闭开关的脉冲。如果开关已经是关闭状态则无效。一般连接交互模块。
输出口
On / Off 输出
A boolean that is true if the switch is on.
开关打开时布尔值为真。一般连接到动画模块。
相关模块
[Pop Animation] [Classic Animation] [Option Switch] [Counter] [Pulse] [Interaction]
相关教程
1. 入门 Getting Started
介绍怎么使用 Origami Studio。
4.添加逻辑 Adding Logic
给过渡和流程添加逻辑。
相关案例
2. Facebook Live Comments
自动在 Facebook Live 视频中添加评论。
3. Messenger Photo View
图片在对话和全屏模式之间切换的动画。
4. Photo Zoom
点击在两个状态之间切换的动画。
5. Facebook New Stories
当新闻滚动一定距离时触发提示出现。
14. Instagram Color Picker
更改 Instagram 文章帖子中的文字颜色。
19. Instagram Direct Messages
重复的向朋友发送Instagram直接消息。