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直接消息。