Collectable |
addAnimation
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
flicker
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
getCurrentAnimationFrame
Returns number
current animation frame index
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
isCurrentAnimation
Returns boolean
isFinite
Returns boolean
false if all coordinates are positive or negative Infinity or NaN; otherwise, true.
isFlickering
Returns boolean
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
pause
Returns void
play
Returns void
postDraw
postDraw(renderer: CanvasRenderer | WebGLRenderer): void
Returns void
preDraw
Returns void
recalc
Returns Collectable
Reference to this object for method chaining
resize
reverseAnimation
reverseAnimation(name?: string): Sprite
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
setAnimationFrame
setAnimationFrame(index?: number): Sprite
setCurrentAnimation
setOpacity
Returns void
setRegion
setShape
setSize
Parameters
- width: number
- height: number
Returns Collectable
setVertices
shift
Parameters
- x: number
Optionaly: number
Returns void
Returns void
to2d
Returns Collectable
Reference to this object for method chaining
toIso
Returns Collectable
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
Protectedupdate
ProtectedReturns boolean
true if the Sprite is dirty
updateBounds
updateBounds(absolute?: boolean): Bounds