UI.Font
Index
Constructors
constructor
Properties
alignment
color
isBold
isCursive
isUnderlined
shadow
size
staticreadonlyALIGN_CENTER
Aligns text to the start of the element (left for English locale).
staticreadonlyALIGN_CENTER_HORIZONTALsince: 2.2.1b96
Aligns text to the center of the element horizontally.
staticreadonlyALIGN_DEFAULT
Aligns text to the center of the element.
staticreadonlyALIGN_END
Aligns text to the end of the element (right for English locale).
Methods
asScriptable
Converts current Font object to scriptable font description.
Returns FontDescription
drawText
Draws text on the canvas using created font.
Parameters
canvas: Canvas
android.graphics.Canvas instance to draw the text on
x: number
x coordinate of the text in pixels
y: number
x coordinate of the text in pixels
text: string
text string to draw
scale: number
additional scale to apply to the text
Returns void
getBounds
Calculates bounds of the text given text position, text string and additional scale.
Parameters
text: string
x: number
y: number
scale: number
Returns Rect
rect object containing calculated bounds of the text
getTextHeight
Calculates text height given text string and additional scale.
Parameters
text: string
x: number
y: number
scale: number
Returns number
height of the specified string when painted with specified scale
getTextWidth
Calculates text width given text string and additional scale.
Parameters
text: string
scale: number
Returns number
width of the specified string when painted with specified scale
Class representing font used in the UI.