Application.Settings

typedef Settings

object

Application & Renderer Settings definition.

See: Application

Summary


Properties from Settings

boolean
static antiAlias = false
HTMLCanvasElement
static canvas
boolean
static consoleHeader = true
"sorting" | "z-buffer"
static depthTest = "sorting"
string | HTMLElement
static parent = document.body
"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

Public Properties


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

boolean

whether to enable or not video scaling interpolation

canvas settings.js:24
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)

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

boolean

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

depthTest settings.js:24
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:24
static parent: string | HTMLElement = document.body

string | HTMLElement

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

powerPreference settings.js:24
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:24
static preferWebGL1: boolean = false

boolean

if true the renderer will only use WebGL 1

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

number | Renderer

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

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

number | string

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

scaleMethod settings.js:24
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:24
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:24
static transparent: boolean = false

boolean

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


Powered by webdoc!