Phaser API Documentation

  Version: 
setOffset(x, [y])

Description:

Sets the body offset. This allows you to adjust the difference between the center of the body and the x and y coordinates of the parent Game Object.

Parameters:

name type arguments Default description
x number

The amount to offset the body from the parent Game Object along the x-axis.

y number <optional> x

The amount to offset the body from the parent Game Object along the y-axis. Defaults to the value given for the x-axis.

Returns:
Description:

This Game Object.

Since: 3.0.0