Renderable |
angleTo
Returns number
angle in radians
centerOn
clone
Returns Rect
new rectangle
contains
Parameters
- x: number
- y: number
Returns boolean
True if the polygon contain the point, otherwise false
Returns boolean
True if the polygon contain the point, otherwise false
containsRectangle
copy
distanceTo
draw
Returns void
equals
equals(rect: Rect): boolean
Returns boolean
true if equals
flipX
Parameters
Optionalflip: boolean = true
Returns Renderable
Reference to this object for method chaining
flipY
Parameters
Optionalflip: boolean = true
Returns Renderable
Reference to this object for method chaining
getAbsolutePosition
Returns Vector2d
getBounds
Returns Bounds
bounding box Rectangle object
getIndices
Returns number[]
an array of vertex indices for all triangles forming this polygon.
getOpacity
Returns number
current opacity value between 0 and 1
isConvex
Returns boolean | null
true if the vertices are convex, false if not, null if not computable
isFinite
Returns boolean
false if all coordinates are positive or negative Infinity or NaN; otherwise, true.
lookAt
Returns Renderable
Reference to this object for method chaining
onCollision
Returns boolean
true if the object should respond to the collision (its position and velocity will be corrected)
onDestroyEvent
Returns void
overlaps
overlaps(rect: Rect): boolean
Returns boolean
true if overlaps
postDraw
postDraw(renderer: CanvasRenderer | WebGLRenderer): void
Returns void
preDraw
Returns void
recalc
Returns Renderable
Reference to this object for method chaining
resize
rotate
scale
Parameters
- x: number
Optionaly: number = x
Returns Renderable
Reference to this object for method chaining
scaleV
Returns Renderable
Reference to this object for method chaining
setOpacity
Returns void
setShape
Returns Renderable
this instance for objecf chaining
setSize
setSize(width: number, height: number): Renderable
Parameters
- width: number
- height: number
Returns Renderable
setVertices
Returns Renderable
this instance for objecf chaining
shift
Parameters
- x: number
Optionaly: number
Returns void
Returns void
to2d
Returns Renderable
Reference to this object for method chaining
toIso
Returns Renderable
Reference to this object for method chaining
toPolygon
Returns Polygon
a new Polygon that represents this rectangle.
transform
Returns Renderable
Reference to this object for method chaining
translate
union
update
Returns boolean
true if the renderable is dirty
updateBounds
updateBounds(absolute?: boolean): Bounds