12-Origami中文帮助-Concepts-Coordinates

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像素的一个层组:

12-Origami中文帮助-Concepts-Coordinates_第1张图片



Anchor Point       锚点


Some patches take an Anchor Point input. This input changes the origin of the coordinate system, but only for that patch.

有些模块有一个输入的锚点,这个输入可以改变原有的坐标系统,但是只针对这个模块。

12-Origami中文帮助-Concepts-Coordinates_第2张图片

Here's an example of a Text Layer positioned from the "Top Left" Anchor Point:

这是一个例子,一个文字层的位置开始于左上方的锚点。

12-Origami中文帮助-Concepts-Coordinates_第3张图片

From the bottom right:

位置开始于右下方:

12-Origami中文帮助-Concepts-Coordinates_第4张图片

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.

12-Origami中文帮助-Concepts-Coordinates_第5张图片

你可能感兴趣的:(12-Origami中文帮助-Concepts-Coordinates)