1681-engine / ui / FitOptions
Interface: FitOptions ​
Defined in: src/ui/layout/fitToViewport.ts:3
Properties ​
centre? ​
optional centre?: boolean;Defined in: src/ui/layout/fitToViewport.ts:17
Centre it on the screen instead of keeping rect.x/y (default false).
margin? ​
optional margin?: number;Defined in: src/ui/layout/fitToViewport.ts:5
Kept clear between the window and the screen's edges (default 8).
minScale? ​
optional minScale?: number;Defined in: src/ui/layout/fitToViewport.ts:15
The smallest scale it may shrink to before it starts scrolling instead (default: scale, never shrinks). A pixel-art game keeps it at its whole scale: a fractional one smears every texel.
scale? ​
optional scale?: number;Defined in: src/ui/layout/fitToViewport.ts:10
The scale the window is meant to be drawn at (default 1): a player's "window size" setting, or a whole multiple for pixel art. The window is laid out on a box 1 / scale the screen and drawn back at scale.
snap? ​
optional snap?: boolean;Defined in: src/ui/layout/fitToViewport.ts:18