Phaser API Documentation


Member of: Phaser.Actions

<static> PlaceOnRectangle(items, rect, [shift])


Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle.

Placement starts from the top-left of the rectangle, and proceeds in a clockwise direction. If the shift parameter is given you can offset where placement begins.


name type arguments Default description
items array | Array.<Phaser.GameObjects.GameObject>

An array of Game Objects. The contents of this array are updated by this Action.

rect Phaser.Geom.Rectangle

The Rectangle to position the Game Objects on.

shift number <optional> 1

An optional positional offset.


The array of Game Objects that was passed to this Action.

Since: 3.0.0