Skip to main content
Version: Phaser Editor v5-beta

Rectangle

You can create a Rectangle by dropping the Rectangle block, from the Blocks view, on the scene.

Create a rectangle.

You can change the size of the Rectangle in the Size section or you can use the Size tool.

Change the rectangle size.

Since Phaser 4, you can set the Rounded property to give rounded corners to the rectangle. By default it is set to 0 (no rounded corners).

rectangle rounded

The Rectangle code is generated by the scene compiler using the rectangle object factory:

const rectangle = this.add.rectangle(10, 10, 100, 100);