Line
A brief reference to the Line class.
Last updated
Was this helpful?
A brief reference to the Line class.
Last updated
Was this helpful?
You can initialize a Line in a few different ways:
You can move the Line using slightly modified methods from Object:
We can translate by a specified amount with:
We can move both positions to new locations with:
We can change only one of the positions with either:
Retrieve both positions in a tuple using the familiar:
You can rotate lines just as you would expect:
Or we can pass a location in for the line to look at:
You can change the Color of a Line just like a Renderable:
You can modify the thickness of the line in pixels with:
You may decide to change the line to a dotted line with:
You can get the length of the line by calling:
Visibility is accessed exactly as it is in Renderable:
Transforms and cloning work as in Renderable:
Line's transform is a tuple with both positions and current angle.
Cloning works as expected:
The Line's version of 's overlaps()
is intersects()
. It can take any Renderable or Line and will check if the line intersects with any of their lines.