BiLine
A BiLine contains screen coordinates. It can be used to store eg. a line. This class is used in animation. Storage is implemented as a stack where you add points at the end.
This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiLine .
Constructor
new BiLine ( )
Parameters
No parameters.
Properties
| Name | Type | get | set | Descripton |
length | Number | ![]() | Accesses internal array length. How many coordinates stored. |
Methods
| Name | Description |
addPoint | Adds a screen coordinate. |
dispose | You should call this whenever you don't need the object any more. |
getXAt | Accesses horizontal value at specified coordinate. |
getYAt | Accesses vertical value at specified coordinate. |
reverse | Reverses the order of all coordinates so that the first becomes the last and vice versa. |
Events
None.
Static Methods
None.
Static Fields
None.
Remarks
None.
Method Details
addPoint
Adds a screen coordinate.
Syntax
object.addPoint ( x,y ) Parameters
| Name | Type | Optional | Default | Descripton |
x | Number | Horizontal position | ||
y | Number | Vertical position |
Return Type
void
dispose
You should call this whenever you don't need the object any more.
Syntax
object.dispose ( ) Parameters
No arguments.
Return Type
void
getXAt
Accesses horizontal value at specified coordinate.
Syntax
object.getXAt ( index ) Parameters
| Name | Type | Optional | Default | Descripton |
index | Number | Which coordinate to return |
Return Type
Number Horizontal position
getYAt
Accesses vertical value at specified coordinate.
Syntax
object.getYAt ( index ) Parameters
| Name | Type | Optional | Default | Descripton |
index | Number | Which coordinate to return |
Return Type
Number Vertical position
reverse
Reverses the order of all coordinates so that the first becomes the last and vice versa.
Syntax
object.reverse ( ) Parameters
No arguments.
Return Type
void
