Reference Source Test
public class | source

Polygon

Describes an polygon

See:

Constructor Summary

Public Constructor
public

constructor(tag: String, duration: Number, points: Array<misc.Point>)

Method Summary

Public Methods
public

clone(): misc.Polygon

Clone a polygon

public
public

getPoints(): Array<misc.Point>

public
public

rotate(originPoint: misc.Point, angleDegrees: Number): *

Rotate all points of polygon around an origin point

public

rotateAroundZero(angleDegrees: Number): misc.Polygon

Optimized algorithm for polygon rotation around coordinate beginning

public

translate(translatePoint: misc.Point): *

Translate all points of polygon

Public Constructors

public constructor(tag: String, duration: Number, points: Array<misc.Point>) source

Params:

NameTypeAttributeDescription
tag String

Additional information about polygon to describe it

duration Number

Polygon will be destroyed after given number of milliseconds

points Array<misc.Point>

Array of points which can describe an polygon

Public Methods

public clone(): misc.Polygon source

Clone a polygon

Return:

misc.Polygon

Cloned polygon

public getDuration(): Number source

Return:

Number

Get duration of milliseconds after the polygon will be destroyed

public getPoints(): Array<misc.Point> source

Return:

Array<misc.Point>

Get an array of points which describe a polygon

public getTag(): String source

Return:

String

Get unique identifier of polygon

public rotate(originPoint: misc.Point, angleDegrees: Number): * source

Rotate all points of polygon around an origin point

Params:

NameTypeAttributeDescription
originPoint misc.Point

Center point of rotation

angleDegrees Number

Required angle of rotation

Return:

*

public rotateAroundZero(angleDegrees: Number): misc.Polygon source

Optimized algorithm for polygon rotation around coordinate beginning

Params:

NameTypeAttributeDescription
angleDegrees Number

Return:

misc.Polygon

public translate(translatePoint: misc.Point): * source

Translate all points of polygon

Params:

NameTypeAttributeDescription
translatePoint misc.Point

Point which represents x and y value of translation

Return:

*