Skip to content

anim-format (runtime format) / anchorMatrix

Function: anchorMatrix() ​

ts
function anchorMatrix(
   an, 
   stage, 
   view
): Matrix;

THE anchor matrix: authored stage space → shown stage space for a layer with anchor an, the authored stage stage and the visible view (stageFit().view). Left / top keep the distance to that edge, right / bottom to the far edge, centre / middle to the view's centre; stretch maps the authored edges onto the view's (scales that axis). The view equal to the stage = identity.

Parameters ​

ParameterType
anAnimAnchor
stage{ height: number; width: number; }
stage.heightnumber
stage.widthnumber
viewStageRect

Returns ​

Matrix

HereSplash — 2D animation for the web