Micrio Client - v6.0.0
    Preparing search index...

    Class Canvas

    Manages the HTML <canvas> element used for WebGL rendering, handles resizing, and provides viewport information. Accessed via micrio.canvas.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    element: HTMLCanvasElement = ...

    The main WebGL rendering <canvas> element.

    isMobile: Writable<boolean> = ...

    Writable Svelte store indicating if the client is likely a mobile device.

    viewport: Models.Canvas.ViewRect = ...

    Object containing current viewport dimensions, position, and ratios.

    Accessors

    • get $isMobile(): boolean

      Getter for the current value of the isMobile store.

      Returns boolean

    Methods

    • Gets the appropriate device pixel ratio for rendering. Clamped between 1 and 2, disabled on iOS and if noRetina setting is true.

      Parameters

      • s: Partial<Settings> = ...

        Optional image settings object to check for noRetina.

      Returns number

      The calculated device pixel ratio.

    • Sets virtual offset margins in the engine controller. This likely affects how viewports are calculated or limited.

      Parameters

      • width: number

        The horizontal offset margin in pixels.

      • height: number

        The vertical offset margin in pixels.

      Returns void