mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
Add delta arg to WORLD_STEP event
This commit is contained in:
parent
8f48d39934
commit
e194e9586f
2 changed files with 7 additions and 5 deletions
|
@ -983,7 +983,7 @@ var World = new Class({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit(Events.WORLD_STEP);
|
this.emit(Events.WORLD_STEP, fixedDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process any additional steps this frame
|
// Process any additional steps this frame
|
||||||
|
@ -1042,7 +1042,7 @@ var World = new Class({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.emit(Events.WORLD_STEP);
|
this.emit(Events.WORLD_STEP, delta);
|
||||||
|
|
||||||
this.stepsLastFrame++;
|
this.stepsLastFrame++;
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,15 +6,17 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Arcade Physics World Step Event.
|
* The Arcade Physics World Step Event.
|
||||||
*
|
*
|
||||||
* This event is dispatched by an Arcade Physics World instance whenever a physics step is run.
|
* This event is dispatched by an Arcade Physics World instance whenever a physics step is run.
|
||||||
* It is emitted _after_ the bodies and colliders have been updated.
|
* It is emitted _after_ the bodies and colliders have been updated.
|
||||||
*
|
*
|
||||||
* In high framerate settings this can be multiple times per game frame.
|
* In high framerate settings this can be multiple times per game frame.
|
||||||
*
|
*
|
||||||
* Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`.
|
* Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`.
|
||||||
*
|
*
|
||||||
* @event Phaser.Physics.Arcade.Events#WORLD_STEP
|
* @event Phaser.Physics.Arcade.Events#WORLD_STEP
|
||||||
* @since 3.18.0
|
* @since 3.18.0
|
||||||
|
*
|
||||||
|
* @param {number} delta - The delta time amount of this step, in seconds.
|
||||||
*/
|
*/
|
||||||
module.exports = 'worldstep';
|
module.exports = 'worldstep';
|
||||||
|
|
Loading…
Reference in a new issue