TranslateLayer(id, dx, dy)
dx
and dy
. A translation means that the layer is moved relative to its
current position by the specified offset. Thus, a translation of (100,-100)
would move the layer 100 pixels towards the right and 100 pixels towards
the top. A translation of (0,0) would not move the layer at all.
Translations are very useful for moving layers independent of its current
position.
Alternatively, you can also use the TranslateX
and TranslateY
tags of
the powerful SetLayerStyle() command.
TranslateLayer(1, -50, -50)The code above moves the first layer 50 pixels in top-left direction.