gamvas.config

Several userconfigurable variables

Summary
gamvas.configSeveral userconfigurable variables
Variables
preventKeyEventsCapture the whole documents key events?
preventMouseEventsCapture the whole documents mouse events?
worldPerStateUse one physics world per game state?
reverseLayerOrderReverse layer sorting

Variables

preventKeyEvents

preventKeyEvents: false

Capture the whole documents key events?

If true, every key event on the page will be handled by gamvas.  This disables scrolling with cursor keys and other keyboard shortcuts.  When false, only keys that are explicitly handled by the running game are not given to the browser, everything else is put through

Default

false

preventMouseEvents

preventMouseEvents: false

Capture the whole documents mouse events?

If true, every mouse event on the page will be handled by gamvas.  You can not select input fields, or click on the scrollbar.  When false, only if the event handler like for example <gamvas.actor.onKeyDown> returns false, the mouse event will not be put through to the browser.

Default

false

worldPerState

worldPerState: true

Use one physics world per game state?

If true, every game state will have its own physics world, compared to one physics world for the full game.

Default

true

reverseLayerOrder

reverseLayerOrder: false

Reverse layer sorting

The first versions of gamvas had a error, detected by forum user bogdanaslt, where the value of <gamvas.actor.layer> was the wrong way, so a background layer had to have a higher layer value then a foreground object to be rendered below the foreground object.

If you have used layers before introduction of this fix (0.8.3), you have to options, rearrange your code to work with the correct layering (as in layer 0 = background, layer 1 = before background, or you have to set this variable to true BEFORE starting gamvas to use the old - wrong - sorting.

Default

false

preventKeyEvents: false
Capture the whole documents key events?
preventMouseEvents: false
Capture the whole documents mouse events?
worldPerState: true
Use one physics world per game state?
reverseLayerOrder: false
Reverse layer sorting
Close