Phaser API Documentation

  Version: 
staticBody(x, y, [width], [height])

Description:

Creates a new static physics Body with the given position and size.

This Body is not associated with any Game Object, but still exists within the world and can be tested for collision, etc.

Parameters:

name type arguments Default description
x number

The horizontal position of this Body in the physics world.

y number

The vertical position of this Body in the physics world.

width number <optional> 64

The width of the Body in pixels. Cannot be negative or zero.

height number <optional> 64

The height of the Body in pixels. Cannot be negative or zero.

Returns:
Description:

The Body that was created.

Since: 3.60.0