Phaser API Documentation

  Version: 
setOffset(x, [y])

Description:

Sets the offset of the Body's position from its Game Object's position. The Body's position isn't changed until the next preUpdate.

Parameters:

name type arguments Default description
x number

The horizontal offset, in source pixels.

y number <optional> x

The vertical offset, in source pixels.

Returns:
Description:

This Body object.

Since: 3.0.0