Skip to content

Commit 7e4c08c

Browse files
committed
Added new property syncToRender
1 parent 58d40fa commit 7e4c08c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/physics/arcade/World.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ var World = new Class({
154154
*/
155155
this.fps = GetValue(config, 'fps', 60);
156156

157+
/**
158+
* Physics/Render synchronisation. This property disables fps and timeScale properties.
159+
*
160+
* @name Phaser.Physics.Arcade.World#syncToRender
161+
* @type {boolean}
162+
* @default false
163+
* @since 3.23.0
164+
*/
165+
this.syncToRender = false;
166+
157167
/**
158168
* The amount of elapsed ms since the last frame.
159169
*
@@ -927,6 +937,13 @@ var World = new Class({
927937
// Will a step happen this frame?
928938
var willStep = (this._elapsed >= msPerFrame);
929939

940+
if(this.syncToRender)
941+
{
942+
fixedDelta = delta * 0.001;
943+
willStep = true;
944+
this._elapsed = 0;
945+
}
946+
930947
for (i = 0; i < bodies.length; i++)
931948
{
932949
body = bodies[i];

0 commit comments

Comments
 (0)