addLineSegment(layer,{ax,ay,bx,by,thickness}, ...properties) -> id , method of scene

Add a new LineSegment to a layer of the world.

Parameters:
name type description
layer int layer of the world (must be >= 0)
ax num x coordinate of the first end
ay num y coordinate of the first end
bx num x coordinate of the opposite end
by num y coordinate of the opposite end
thickness int must be >= 0
properties …Object each with Sprite properties for a LineSegment
Returns

the identifier (int) of the sprite

// add a new LineSegment with thickness 2 between point 0,0 and point 100,100 to layer zero.

UB.scene.addLineSegment(0,{ax:0, ay:0, bx:100, by:100, thickness: 2});

See all methods of the api.