Type Alias ApplicationSettings

ApplicationSettings: {
    antiAlias: boolean;
    blendMode: BlendMode;
    compositor?: Compositor;
    consoleHeader: boolean;
    depthTest: DepthTest;
    failIfMajorPerformanceCaveat: boolean;
    legacy: boolean;
    physic: PhysicsType;
    powerPreference: PowerPreference;
    preferWebGL1: boolean;
    renderer: RendererType | Renderer;
    scale: number | "auto";
    scaleMethod: ScaleMethod;
    scaleTarget: HTMLElement;
    subPixel: boolean;
    transparent: boolean;
    verbose: boolean;
} & ({
    canvas?: never;
    parent: HTMLElement;
} | {
    canvas: HTMLCanvasElement;
    parent?: never;
})

Type declaration

  • antiAlias: boolean

    whether to enable or not video scaling interpolation

    false
    
  • blendMode: BlendMode
  • Optionalcompositor?: Compositor

    a custom compositor class (WebGL only)

  • consoleHeader: boolean

    whether to display melonJS version and basic device information in the console

    true
    
  • depthTest: DepthTest

    ~Experimental~ the default method to sort object on the z axis in WebGL

    sorting
    
  • failIfMajorPerformanceCaveat: boolean
  • legacy: boolean
  • physic: PhysicsType

    the physic system to use (default: "builtin", or "none" to disable builtin physic)

    "builtin"
    
  • powerPreference: PowerPreference

    a hint to the user agent indicating what configuration of GPU is suitable for the WebGL context. To be noted that Safari and Chrome (since version 80) both default to "low-power" to save battery life and improve the user experience on these dual-GPU machines.

    default
    
  • preferWebGL1: boolean

    if true the renderer will only use WebGL 1

    false
    
  • renderer: RendererType | Renderer

    renderer to use (CANVAS, WEBGL, AUTO), or a custom renderer class

    AUTO
    
  • scale: number | "auto"

    enable scaling of the canvas ('auto' for automatic scaling)

    1
    
  • scaleMethod: ScaleMethod

    screen scaling modes

    fit
    
  • scaleTarget: HTMLElement

    the HTML Element to be used as the reference target when using automatic scaling (by default melonJS will use the parent container of the div element containing the canvas)

  • subPixel: boolean
  • transparent: boolean

    whether to allow transparent pixels in the front buffer (screen).

    false
    
  • verbose: boolean