Namespace: sys

me. sys

global system settings and browser capabilities
Source:
config.js, line 19

Members

<static> fps :Number

Set game FPS limiting
Type:
  • Number
Default Value:
  • 60
Source:
config.js, line 32
See:

<static> gravity :Number|undefined

Global gravity settings
will override entities init value if defined
Type:
  • Number | undefined
Default Value:
  • undefined
Source:
config.js, line 68

<static> interpolation :Boolean

Enable/disable frame interpolation
Type:
  • Boolean
Default Value:
  • false
Source:
config.js, line 51
See:

<static> pauseOnBlur :Boolean

Specify whether to pause the game when losing focus.
Type:
  • Boolean
Default Value:
  • true
Source:
config.js, line 87

<static> preRender :Boolean

Specify the rendering method for layers
if false, visible part of the layers are rendered dynamically
if true, the entire layers are first rendered into an offscreen canvas
the "best" rendering method depends of your game
(amount of layer, layer size, amount of tiles per layer, etc.)
note : rendering method is also configurable per layer by adding this property to your layer (in Tiled)
Type:
  • Boolean
Default Value:
  • false
Source:
config.js, line 119

<static> resumeOnFocus :Boolean

Specify whether to unpause the game when gaining focus.
Type:
  • Boolean
Default Value:
  • true
Source:
config.js, line 95

<static> scale :me.Vector2d

Global scaling factor
Type:
Default Value:
  • <0,0>
Source:
config.js, line 59

<static> stopOnAudioError :Boolean

Specify either to stop on audio loading error or not
if true, melonJS will throw an exception and stop loading
if false, melonJS will disable sounds and output a warning message in the console
Type:
  • Boolean
Default Value:
  • true
Source:
config.js, line 79

<static> stopOnBlur :boolean

Specify whether to stop the game when losing focus or not
The engine restarts on focus if this is enabled.
Type:
  • boolean
Default Value:
  • false
Source:
config.js, line 104

<static> updatesPerSecond :Number

Rate at which the game updates;
must be equal to or lower than the fps
Type:
  • Number
Default Value:
  • 60
Source:
config.js, line 42
See:

Methods

<static> checkVersion(first, second) → {Number}

Compare two version strings
Parameters:
Name Type Argument Default Description
first String First version string to compare
second String <optional>
"4.1.1" Second version string to compare
Source:
config.js, line 141
Returns:
comparison result
< 0 : first < second
0 : first == second
> 0 : first > second
Type
Number
Example
if (me.sys.checkVersion("4.1.1") > 0) {
    console.error(
        "melonJS is too old. Expected: 4.1.1, Got: " + me.version
    );
}
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.