Documentation / @debuffjp/core / ScaleMode
Type Alias: ScaleMode
ScaleMode =
"fit"|"integer"|"expand"|"pixel"|"none"
Defined in: core/src/game.ts:32
How the logical resolution maps onto the page:
fit: scale to fill the container, preserving aspect ratio (letterboxed).integer: likefitbut only whole-number scales, for crisp pixel art.expand: likefit, but instead of letterboxing, the logical size grows along the spare axis to fill the container.width/heightare the minimum;game.width/game.heightchange on resize (seehooks.resize), so lay out from them each frame. For responsive games: portrait on phones, landscape on desktop.pixel: each logical unit ispixelSizeCSS pixels (snapped to whole device pixels), and the logical size grows with the container in both directions, so a bigger window or monitor shows more of the game rather than bigger pixels.width/heightare the minimum: a container too small for them atpixelSizescales down by whole device pixels instead, and one too small even at one device pixel per unit scales down by a fraction to fit, likefit(pixels aren't crisp then). Before 0.29.3 it stopped at one device pixel per unit, so the canvas overflowed the container. Likeexpand, lay out fromgame.width/game.heighteach frame.none: canvas stays at its logical size in CSS pixels.