ApplicationSettings

typedef ApplicationSettings

Object

Application & Renderer Settings definition.

Summary


Properties from ApplicationSettings

boolean
static antiAlias = false
HTMLCanvasElement
static canvas
Compositor
static compositor
boolean
static consoleHeader = true
"sorting" | "z-buffer"
static depthTest = "sorting"
string | HTMLElement
static parent = document.body
string
static physic = "builtin"
"default" | "high-performance" | "low-power"
static powerPreference = "default"
boolean
static preferWebGL1 = false
number | Renderer
static renderer = AUTO
number | string
static scale = 1.0
"fit" | "fill-min" | "fill-max" | "flex" | "flex-width" | "flex-height" | "stretch"
static scaleMethod = "fit"
string | HTMLElement
static scaleTarget
boolean
static transparent = false
number
static zoomX = width
number
static zoomY = height

Public Properties


antiAlias settings.js:1
static antiAlias: boolean = false

boolean

whether to enable or not video scaling interpolation

canvas settings.js:1
static canvas: HTMLCanvasElement

HTMLCanvasElement

an existing canvas element to use as the renderer target (by default melonJS will create its own canvas based on given parameters)

compositor settings.js:1
static compositor: Compositor

Compositor

a custom compositor class (WebGL only)

consoleHeader settings.js:1
static consoleHeader: boolean = true

boolean

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

depthTest settings.js:1
static depthTest: "sorting" | "z-buffer" = "sorting"

"sorting" | "z-buffer"

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

parent settings.js:1
static parent: string | HTMLElement = document.body

string | HTMLElement

the DOM parent element to hold the canvas in the HTML file

physic settings.js:1
static physic: string = "builtin"

string

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

powerPreference settings.js:1
static powerPreference: "default" | "high-performance" | "low-power" = "default"

"default" | "high-performance" | "low-power"

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.

preferWebGL1 settings.js:1
static preferWebGL1: boolean = false

boolean

if true the renderer will only use WebGL 1

renderer settings.js:1
static renderer: number | Renderer = AUTO

number | Renderer

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

scale settings.js:1
static scale: number | string = 1.0

number | string

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

scaleMethod settings.js:1
static scaleMethod: "fit" | "fill-min" | "fill-max" | "flex" | "flex-width" | "flex-height" | "stretch" = "fit"

"fit" | "fill-min" | "fill-max" | "flex" | "flex-width" | "flex-height" | "stretch"

screen scaling modes :

  • fit : Letterboxed; content is scaled to design aspect ratio

- `fill-min` : Canvas is resized to fit minimum design resolution; content is scaled to design aspect ratio

- `fill-max` : Canvas is resized to fit maximum design resolution; content is scaled to design aspect ratio

- `flex`< : Canvas width & height is resized to fit; content is scaled to design aspect ratio

- `flex-width` : Canvas width is resized to fit; content is scaled to design aspect ratio

- `flex-height` : Canvas height is resized to fit; content is scaled to design aspect ratio

- `stretch` : Canvas is resized to fit; content is scaled to screen aspect ratio
scaleTarget settings.js:1
static scaleTarget: string | HTMLElement

string | 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)

transparent settings.js:1
static transparent: boolean = false

boolean

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

zoomX settings.js:1
static zoomX: number = width

number

The actual width of the canvas with scaling applied

zoomY settings.js:1
static zoomY: number = height

number

The actual height of the canvas with scaling applied


Powered by webdoc!