Skip to content

setLength()

Set the line's length.

Keeps the first end and the direction fixed, and moves the second end so the line is the given length.

NOTE: setLength() is only available for Line objects.

Parameters

Once an object line has been created, you can use the following function:

line.setLength(length)
Parameter Type Default Description
length int or float required The new length, in pixels.