Max*_*and 8 javascript photoshop photoshop-script flash-cs5
我有一个活动ArtLayer引用变量NewLayer,我想移动到画布中的绝对位置x,y.
我现在谷歌搜索几个小时没有任何结果.有人可以举个例子吗?
// 谢谢.
Max*_*and 21
经过一些API读取和搜索后,我得出的结论是,只能移动一个带有delta移动的图层.
我写了这个小函数来将图层定位在绝对位置.希望这对下一位有相同问题的读者有所帮助......
//******************************************
// MOVE LAYER TO
// Author: Max Kielland
//
// Moves layer fLayer to the absolute
// position fX,fY. The unit of fX and fY are
// the same as the ruler setting.
function MoveLayerTo(fLayer,fX,fY) {
var Position = fLayer.bounds;
Position[0] = fX - Position[0];
Position[1] = fY - Position[1];
fLayer.translate(-Position[0],-Position[1]);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13354 次 |
| 最近记录: |