You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a game object with a static Arcade Physics body. Give the body an offset with setOffset(x, y).
Reset the body with any coordinates. Now the body position doesn't include the offset.
Call setOffset(x, y) again. The body position is the same — still no offset.
Example Test Code
constimage=this.physics.add.staticImage(0,0,'32x32').setOffset(16,16);// These pass.console.assert(image1.body.x===0);console.assert(image1.body.y===0);// Reset on the original position.image.body.reset(0,0);// These fail.console.assert(image1.body.x===0);console.assert(image1.body.y===0);
Version
Description
Create a game object with a static Arcade Physics body. Give the body an offset with
setOffset(x, y)
.Reset the body with any coordinates. Now the body position doesn't include the offset.
Call
setOffset(x, y)
again. The body position is the same — still no offset.Example Test Code
Also https://codepen.io/samme/pen/wvOjoGK?editors=0010
The text was updated successfully, but these errors were encountered: