Text

A text entity created by add.text

virtuosity.engine2d.Text

Components


pixi

reference to the render object



Parameter Type Description
pixi Pixi.js object reference to the pixi render object (internal)
type String the type of the Entity

id

reference to id of the render object.



Parameter Type Description
id String reference to id of the render object

position

position of the render object



Parameter Type Description
x Number x coordinate of the render object
y Number y coordinate of the render object

size

get the size of the render object



Parameter Type Description
width Number width of the render object
height Number height of the render object

rotation

rotation of the render object

Parameter Type Description Default
rotation Number rotation of the render object 0

anchor

the position and rotation point of the render object

Parameter Type Description Default
x Number x coordinate of the anchor point 0
y Number y coordinate of the anchor point 0

alpha

alpha of the render object

Parameter Type Description Default
alpha Number alpha of the render object 1

style

stylization of the text

Parameter Type Description Default
fontSize Int size of the font in pixels
fontFamily String font type of the text "Trebuchet"
fill Hex color of the text 0xffffff
align String alignment of the text "left"
stroke Hex color of the text outline "0x000000"
strokeThickness Int thickness of the text outline 0
letterSpacing Int spacing between the letters 0
lineHeight Int line height of the text fontSize + 2
fontWeight Int thickness of the text (increments of 100, 100-900) 400
fontStyle String style of the text, (normal|italic|oblique) "normal"

zIndex

zIndex of the render object

Parameter Type Description Default
zIndex Number zIndex of the render object 0

pivot

the position and rotation point of the render object

Parameter Type Description Default
x Number x coordinate of the pivot point 0
y Number y coordinate of the pivot point 0

text

value of the text shown



Parameter Type Description
text String value of the text shown