Text | melonJS
angleTo
Returns number
angle in radians
bold
Returns Text
this object for chaining
centerOn
centerOn(x: number, y: number): Text
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
Returns Text
new rectangle
distanceTo
draw
Parameters
- renderer: any
Optionaltext: stringOptionalx: number = ...Optionaly: number = ...
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.
italic
Returns Text
this object for chaining
lookAt
Returns Renderable
Reference to this object for method chaining
measureText
Parameters
- renderer: any
Optionaltext: string = ...
Returns TextMetrics
a TextMetrics object defining the dimensions of the given piece of text
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 Text
Reference to this object for method chaining
resize
resize(w: number, h: number): Text
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
setFont
setFont(font: string, size?: string | number): Text
setOpacity
Returns void
setShape
setSize
setText
setText(value?: string | number | string[]): Text
setVertices
setVertices(vertices: PolygonVertices | LineVertices): Text
shift
Parameters
- x: number
Optionaly: number
Returns void
Returns void
to2d
Returns Text
Reference to this object for method chaining
toIso
Returns Text
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
Returns Text
the union(ed) rectangle
update
Returns boolean
true if the renderable is dirty
updateBounds
updateBounds(absolute?: boolean): Bounds