Dosen原創(chuàng)
這是我學(xué)習(xí)quartz composer喻杈,Origami絮重,看官方文檔翻譯下來(lái)的贷帮,每天一篇败去,有不準(zhǔn)確的地方希望能指出碘裕,一起交流進(jìn)步匆骗。轉(zhuǎn)載請(qǐng)與我聯(lián)系胶背,擅自轉(zhuǎn)載視作侵權(quán)杭措。
Layers????? 層
Layers show content, like images, in the viewer. They work like layers in Sketch and Photoshop: every layer has style attributes (e.g. position, size, an Image or Color to show...), can be different types (see list below), and can be layered on top of each other.
層是個(gè)容器辽社,像在查看器中的圖片伟墙,它們的作用像是在Sketch和Photoshop中的圖層一樣:每個(gè)圖層有一套屬性樣式(比如:位置,尺寸滴铅,一張位圖或是顏色)戳葵,可以是不同類(lèi)型,互相之間可以有層級(jí)汉匙。
Add a layer with the patch library ?“?? ? ” , or their keyboard shortcuts. Quickly add an image as a layer by dragging and dropping the image on to the Editor.
用模塊庫(kù) “ ? ? ” 添加一個(gè)層拱烁,或者通過(guò)快捷鍵。通過(guò)拖拽把圖片拖進(jìn)編輯器來(lái)快速添加一個(gè)圖片作為一個(gè)層噩翠。
1. Layer patches????? 層模塊
Layer →?“ L ”??????
Display a rectangle or image. For non-rectangle shapes, use patches like Circle Image or Rounded Rectangle that create an image to plug into a Layer.
顯示一個(gè)矩形或圖片戏自。對(duì)于非矩形形狀來(lái)說(shuō),使用像Circle Image(圓形圖片)或者Rounded Rectangle(圓角矩形)這樣的模塊來(lái)把一個(gè)圖片放入一個(gè)層中伤锚。
In most situations, you'll be working with an image from your designs by copy-pasting or drag-and-dropping into the editor. This will automatically create a layer patch for you with the image connected.
在大多數(shù)情況下擅笔,你會(huì)用 復(fù)制-粘貼 或者 拖拽-放入 的方式把你設(shè)計(jì)中的圖片放入編輯器,這樣會(huì)自動(dòng)地為你創(chuàng)建一個(gè)連接了圖片的層模塊屯援。
Text Layer →?“?? T ”
Display text with adjustable font settings.
顯示文字猛们,可調(diào)節(jié)字體設(shè)置。
Completely fill the containing Layer Group with a color.
用一個(gè)顏色填充滿(mǎn)Layer Group(層組)狞洋。
2. Layer position????? 層位置
Layers in Origami are positioned in the center by default. You can easily position the layer in different corners of the layer group by changing the Anchor Position. Be aware that some patches (like Scroll) expect Layers to have a center anchor position.
在Origami中弯淘,層默認(rèn)的位置在中心。用changing the Anchor Position(改變錨點(diǎn)位置)可以讓你很容易的把層放置在層組的不同的角落里吉懊。
![](http://upload-images.jianshu.io/upload_images/2404066-cec9aa3f6b6f77d4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
X Position behaves like Sketch and Photoshop, where increasing it moves right, and decreasing moves left. Y Position is reversed: increasing it moves up, and decreasing moves down.
X坐標(biāo)就像Sketch和Photoshop中一樣庐橙,向右移動(dòng)它的值增加假勿,向左移動(dòng)值減少。Y坐標(biāo)是向上移動(dòng)值增加态鳖,向下移動(dòng)值減少转培。
Read more about the Coordinate System.
閱讀更多關(guān)于坐標(biāo)系統(tǒng)。
3. Layer order????? 層順序
Unlike the other attributes of a Layer, the order is specified with a dropdown at the top right of the Patch. You can also change the order by selecting the layer and hitting ?“?? [ ” or “?? ] ”?.
不同于層的其他屬性郁惜,在模塊的右上角通過(guò)下拉指定順序堡距。你也可以選住層,按 “ ? [ ”?或 “ ? ] ” 改變順序兆蕉。
To change the order of a Layer using patches, simply tweak the Z Position by a small amount (like 0.0001 pixels).
使用模塊改變一個(gè)層的順序羽戒,稍微調(diào)整Z坐標(biāo)一點(diǎn)點(diǎn)(比如0.0001像素)就可以了。
4. Layer Groups????? 層組
Layer Groups help you organize your Layers together. Create one from the patch library or simply hit “?G? ” (tip: you can do this while hovered over an image patch to quickly group it). You can double-click or ?“?? ▼ ”? to get into a Layer Group, and click Edit Parent in the toolbar or “ ? ▲ ”??to exit a Layer Group.
層組幫你組織你的層在一起虎韵。從模塊庫(kù)創(chuàng)建一個(gè)或者按 “ G? ” (提示:你可以在懸停在一個(gè)圖片模塊上的時(shí)候易稠,按 “ G? ”,把它組在一起)包蓝,你可以雙擊或者用 “ ? ▼ ” 來(lái)成組驶社,點(diǎn)擊工具欄的Edit Parent(編輯父物體) 或者 “ ? ▲ ” 來(lái)退出層組。
Make sure to group layers whenever you want to animate multiple layers together. For example, if you're sliding up a window with multiple layers inside of it, putting those layers in a layer group will let you just animate up that one group up instead of needing to have cables connected to several different layers.
確保任何時(shí)候你想要?jiǎng)悠饋?lái)層都在一個(gè)層組测萎。舉個(gè)例子亡电,如果你想上滑一個(gè)里面有很多層的窗口,把這些層放在一個(gè)層組硅瞧,會(huì)讓你只需要?jiǎng)右粋€(gè)層組就能可以份乒,而不需要給許多不同的層連線(xiàn)。