03-Origami中文幫助-Basic-Interactions

Dosen原創(chuàng)

這是我學(xué)習(xí)quartz composer,Origami,看官方文檔翻譯下來的,每天一篇,有不準(zhǔn)確的地方希望能指出,一起交流進(jìn)步。轉(zhuǎn)載請與我聯(lián)系,擅自轉(zhuǎn)載視作侵權(quán)。


Interactions ? ? ?交互


Interaction patches give you information about user interactions like touches, clicks, swipes, and key presses in the viewer.

交互模塊給你用戶在查看器中的交互信息,像觸摸,點(diǎn)擊,滑動(dòng),按鍵。



1. Interaction patches ? ? ?交互模塊


Interaction 2 →?“?I ” ? ? ? 交互2

This is the bread and butter of interaction in Origami. It can tell you when a user touches down, touches up, taps (a touch down and up in quick succession), and drags (a touch down that moves). It works well with Layer Groups.

Interaction 2在Origami的交互中很重要。它可以告訴你用戶什么時(shí)候按下,抬起,輕擊(落下接著快速抬起),拖動(dòng)(落下移動(dòng))。它和Layer Groups配合效果很好。

Scroll →? ? ? ? 滾動(dòng)

Lets you scroll a Layer (center-anchored) with momentum and rubberbanding. All it needs to know is the size of the Image you are scrolling, and the type of scrolling you want (Free, Paging, or Wheel of Fortune). Also, see Desktop Scroll →

Scroll讓你有彈力有慣性的滾動(dòng)一個(gè)層(錨點(diǎn)在中心)。它需要知道你滾動(dòng)的圖片的尺寸和你想要滾動(dòng)的方式(自由,翻頁,或者轉(zhuǎn)盤式)。

Swipe →? ? ? ? 滑動(dòng)

This helps you quickly prototype swiping a layer between two positions. Some examples of UIs you can build with this: swiping down to close a dialog, pull-to-refresh, swiping up to reveal a list of options (like 3D Touch Peek and Pop), swiping right to go back, and swiping horizontally to switch between a camera's photo and video modes.

Swipe可以幫助你快速原型展示在兩個(gè)位置間滑動(dòng)圖層。一些UI的例子你可以用它來創(chuàng)建:向下滑動(dòng)關(guān)閉一個(gè)對話,下拉刷新,向上滑動(dòng)顯示菜單,向右滑動(dòng)返回,水平滑動(dòng)切換攝像頭的照片和錄像模式。

Keyboard →?“?K ” ? ? ? 鍵盤

Lets you know when a specific key on your Mac's keyboard is pressed in the viewer. For mobile prototypes, this lets you set up hot keys that configure your prototype into specific states for easy demoing. Assign it to a key using the settings inspector, or by hovering over the patch and pressing a key on your keyboard.

Keyboard能讓你在查看器中知道,在你mac的鍵盤上的一個(gè)特定的按鍵被按下。對于手機(jī)原型來說,這可以讓你設(shè)置快捷鍵,方便展示原型中特殊的狀態(tài)。使用設(shè)置檢查器給它指定一個(gè)按鍵,或者懸停在模塊上并在鍵盤上按下一個(gè)鍵。



2. Interaction ports ? ? ?交互接口


One thing you'll notice with some interaction patches (Interaction 2, Scroll, Swipe) is they have an extra unlabeled port at the top right. That allows you to specify a specific layer to get interactions from, rather than anywhere on screen. Just connect it to the interaction port at the top left of a Layer.

你會(huì)注意到一些交互模塊(Interaction 2,Scroll,Swipe),它們在右上方有一些額外的沒有標(biāo)簽的接口。那個(gè)地方允許你指定一個(gè)特殊的層去獲取交互在哪,而不是屏幕上的任何地方,只需要連接它到一個(gè)層的左上角的交互接口上。



3. Layer order and grouping affects touch detection ? ? ?層的順序和組影響觸摸監(jiān)測


Once you've tied an interaction to a Layer, you will only get interactions if that Layer is the front-most layer at that position. Change layer order with the dropdown in the top-right of a Layer patch, or select the layer and hit “ ? [ ” or “ ? ] ” .

給一個(gè)層綁定一個(gè)交互,只有這個(gè)層是最頂層的情況下,才可以交互。下拉層模塊右上角可以改變層順序,或者選擇層并按“ ? [ ” or “ ? ] ”。

第一句沒按原文翻譯,大概意思應(yīng)該差不多。

Likewise, if you have Layers inside a Layer Group, you will only get interactions for the front-most Layer you are touching. To get interactions on an entire Layer Group itself, simply add Interaction 2 patches to each Layer within, and toggle their Enable ports off. This tells Origami that you don't want those layers to be interactive.

同樣的,如果你在一個(gè)層組里還有一些層,你將只能獲取到你觸摸到的最頂層的交互。想獲得整個(gè)層組的交互,給各個(gè)層添加Interaction 2模塊,并將它們的Enable接口關(guān)閉。這樣就告訴了Origami你不想那些層被交互。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 我講不好之前,先讓意林給你講: 有一個(gè)名叫韋格的奧地利女孩 ,天生麗質(zhì) ,聰慧可人 。她在 一所大學(xué)專修油畫 ,她...
    蝸牛小姐ms閱讀 413評論 0 0

友情鏈接更多精彩內(nèi)容