Dosen原創
這是我學習quartz composer,Origami,看官方文檔翻譯下來的,每天一篇,有不準確的地方希望能指出,一起交流進步。轉載請與我聯系,擅自轉載視作侵權。
Coordinates ? ? ?坐標
In contrast to built-in Quartz Composer patches, the Origami patches (eg. Layer / Text Layer / Layer Group) use pixel coordinates.
Quartz Composer的模塊和Origami的模塊在使用像素坐標上是有差別的(比如:層/文字層/層組)。
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.
原點,也就是坐標為(x = 0, y = 0)的位置,是設備屏幕的中心。坐標向上和向右是增加的,中心點向下和向左是負的坐標。
For illustration, below is a Layer Group of height 400 pixels and width 300 pixels:
看插圖,下面是高度為400像素和寬度為300像素的一個層組:
Anchor Point ? ? ? 錨點
Some patches take an?Anchor Point?input. This input changes the origin of the coordinate system, but only for that patch.
有些模塊有一個輸入的錨點,這個輸入可以改變原有的坐標系統,但是只針對這個模塊。
Here's an example of a Text Layer positioned from the "Top Left" Anchor Point:
這是一個例子,一個文字層的位置開始于左上方的錨點。
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.
如果你的層位置基于右下角,它的位置是右邊貼于屏幕右邊,底邊貼于屏幕底部,不在它的中心。這會使它方便的快速移動一個層到屏幕的角落或者移動它和它的父級。
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.
如果你想使它向左移動40像素向上移動40像素,就給它X位移值-40,Y位移值40.