addCircle(layer, ...objects) -> id , method of scene

Add a new Circle to a layer of the world.

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

the identifier (int) of the sprite

// add a new red Circle with radius 40 and its center at 200,300 to layer zero.

UB.scene.addCircle(0,{x:200, y:300, radius: 40, fill: "#F00"});

Example with physical properties.

    x: 300,
    y: 300,
    radius: 20,
    fill: "#4F5",
    stroke: "#D2E"
}, {
    mass: 1,
    friction: 0.9,
    elasticity: 0.9

See all methods of the api.