MotionScript

@motion-script/core


@motion-script/core / anchorProperty

Variable: anchorProperty

const anchorProperty: (opts?) => (target, propertyKey) => void

Defined in: attributes/properties/typed.ts:194

An anchor property: a named position ('center', 'topLeft', …) resolved to a per-axis Vector2 in [-1, 1] (x: -1 left … +1 right, y: -1 bottom … +1 top), tweened as a vector so 'centerLeft' → 'centerRight' slides.

One decorator for every "which point of this box" prop — Node.pivot, a container's align, an image fill's anchor. They previously had two decorators (alignProperty/pivotProperty) that differed only in whether the default was spelled 'center' or { x: 0, y: 0 } — the same value either side of resolveAnchor.

Parameters

opts?

AttributePropOptions<Anchor, Vector2>

Returns

(target, propertyKey) => void