Dosen原創(chuàng)
這是我學(xué)習(xí)quartz composer腺毫,Origami,看官方文檔翻譯下來(lái)的挣柬,每天一篇潮酒,有不準(zhǔn)確的地方希望能指出,一起交流進(jìn)步邪蛔。轉(zhuǎn)載請(qǐng)與我聯(lián)系急黎,擅自轉(zhuǎn)載視作侵權(quán)。
Coordinates ? ? ?坐標(biāo)
In contrast to built-in Quartz Composer patches, the Origami patches (eg. Layer / Text Layer / Layer Group) use pixel coordinates.
Quartz Composer的模塊和Origami的模塊在使用像素坐標(biāo)上是有差別的(比如:層/文字層/層組)侧到。
The origin, or location of the (x = 0, y = 0) coordinate, is in the center of the device screen. Coordinates increase upwards and to the right. Points downward and leftward of the center have negative coordinates.
原點(diǎn)勃教,也就是坐標(biāo)為(x = 0, y = 0)的位置,是設(shè)備屏幕的中心匠抗。坐標(biāo)向上和向右是增加的故源,中心點(diǎn)向下和向左是負(fù)的坐標(biāo)。
For illustration, below is a Layer Group of height 400 pixels and width 300 pixels:
看插圖汞贸,下面是高度為400像素和寬度為300像素的一個(gè)層組:
Anchor Point ? ? ? 錨點(diǎn)
Some patches take an?Anchor Point?input. This input changes the origin of the coordinate system, but only for that patch.
有些模塊有一個(gè)輸入的錨點(diǎn)绳军,這個(gè)輸入可以改變?cè)械淖鴺?biāo)系統(tǒng)印机,但是只針對(duì)這個(gè)模塊。
Here's an example of a Text Layer positioned from the "Top Left" Anchor Point:
這是一個(gè)例子门驾,一個(gè)文字層的位置開始于左上方的錨點(diǎn)射赛。
From the bottom right:
位置開始于右下方:
Notice that if you position a Layer by its Bottom Right, it positions its right edge to the right of the screen and bottom edge to the bottom of the screen, not its center. This makes it convenient to quickly move a layer to a corner of the screen, or position it within its parent.
如果你的層位置基于右下角,它的位置是右邊貼于屏幕右邊奶是,底邊貼于屏幕底部咒劲,不在它的中心。這會(huì)使它方便的快速移動(dòng)一個(gè)層到屏幕的角落或者移動(dòng)它和它的父級(jí)诫隅。
If you want to inset it left by 40 pixels and up by 40 pixels, give it an X Position of -40 and a Y Position of 40.
如果你想使它向左移動(dòng)40像素向上移動(dòng)40像素,就給它X位移值-40帐偎,Y位移值40.