addRectangle(layer, -> id , method of controller

Add a new Rectangle to a layer on the controller of a player.

name type description
layer int layer of the world (must be >= 0)
properties …Object each with Sprite properties for a Rectangle

the identifier (int) of the sprite

// a new Rectangle with its center at 200,300 and dimensions 40 and 60.

UB.controller(playerID).addRectangle(0, {x:200, y:300, width: 40, height: 60});

See all methods of the api.