mirror of
https://github.com/liabru/matter-js.git
synced 2025-02-07 19:06:26 -05:00
changed Example.views to use render events
This commit is contained in:
parent
b74e40024b
commit
3ac3498712
2 changed files with 2 additions and 3 deletions
|
@ -98,8 +98,8 @@ Example.views = function() {
|
||||||
y: 1
|
y: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
// use the engine tick event to control our view
|
// use a render event to control our view
|
||||||
Events.on(engine, 'beforeTick', function() {
|
Events.on(render, 'beforeRender', function() {
|
||||||
var world = engine.world,
|
var world = engine.world,
|
||||||
mouse = mouseConstraint.mouse,
|
mouse = mouseConstraint.mouse,
|
||||||
translate;
|
translate;
|
||||||
|
|
|
@ -101,7 +101,6 @@ var Common = require('./Common');
|
||||||
/**
|
/**
|
||||||
* A game loop utility that updates the engine and renderer by one step (a 'tick').
|
* A game loop utility that updates the engine and renderer by one step (a 'tick').
|
||||||
* Features delta smoothing, time correction and fixed or dynamic timing.
|
* Features delta smoothing, time correction and fixed or dynamic timing.
|
||||||
* Triggers `beforeTick`, `tick` and `afterTick` events on the engine.
|
|
||||||
* Consider just `Engine.update(engine, delta)` if you're using your own loop.
|
* Consider just `Engine.update(engine, delta)` if you're using your own loop.
|
||||||
* @method tick
|
* @method tick
|
||||||
* @param {runner} runner
|
* @param {runner} runner
|
||||||
|
|
Loading…
Add table
Reference in a new issue