레이어가 델타로만 이동할 수있는 것처럼 보입니다.
델타를 사용하여 이동하려면 MyLayer.transform(DeltaX,DeltaY);
여기서 MyLayer는 이동하려는 artLayer
에 대한 참조입니다. DeltaX와 DeltaY의 단위는 Photoshop의 Ruler와 같습니다.
이 작은 기능을 사용하여 레이어를 절대 위치로 이동했습니다. 이것이 당신에게 약간의 사용이되기를 바랍니다 ...
//******************************************
// MOVE LAYER TO
// Author: Max Kielland
//
// Moves layer fLayer to the absolute
// position fX,fY. The unit of fX and fY is
// 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]);
}