API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classFixedResolutionCanvasSizing
Scales the canvas to its parent while the render resolution stays exactly at the base resolution. The CSS box is the largest base-aspect rectangle that fits the parent, so the canvas grows on a large display and shrinks on a small one, but the backing store is always `base x pixelRatio` and the logical coordinate system is always the base resolution. Whatever space the parent has left over around that rectangle stays the page's - nothing is drawn into it. The mode for a deliberately constant internal resolution: retro and pixel-art rendering, a fixed GPU cost per frame, or any presentation where the canvas is an image that is merely scaled to the viewport. Requires a canvas element with a parent in the document.
import { FixedResolutionCanvasSizing } from '@codexo/exojs'Scales the canvas to its parent while the render resolution stays exactly at the base resolution.
The CSS box is the largest base-aspect rectangle that fits the parent, so the canvas grows on a large display and shrinks on a small one, but the backing store is always `base x pixelRatio` and the logical coordinate system is always the base resolution. Whatever space the parent has left over around that rectangle stays the page's - nothing is drawn into it.
The mode for a deliberately constant internal resolution: retro and pixel-art rendering, a fixed GPU cost per frame, or any presentation where the canvas is an image that is merely scaled to the viewport.
Requires a canvas element with a parent in the document.
new(): FixedResolutionCanvasSizingdetach(): void