Skip to content

anim-format (runtime format) / stageFit

Function: stageFit() ​

ts
function stageFit(
   stage, 
   screen, 
   scale?, 
   align?
): StageFit;

THE page layout of a fixed stage (Properties › Stage scale / align): "fit" scales the authored stage to fit the screen whole (aspect kept), "none" keeps 100 %, a number is that scale; "center" puts the stage in the middle (whole screen pixels), "topLeft" at the corner. The view is what the screen shows of the stage's space around it.

Parameters ​

ParameterTypeDefault value
stage{ height: number; width: number; }undefined
stage.heightnumberundefined
stage.widthnumberundefined
screen{ height: number; width: number; }undefined
screen.heightnumberundefined
screen.widthnumberundefined
scale?number | "fit" | "none""fit"
align?"center" | "topLeft""center"

Returns ​

StageFit

HereSplash — 2D animation for the web