|
a2GetTextWidth()
This function returns the width of a text string rendered with Advance 2D text commands.
Return Integer = a2GetTextWidth(fontID, text)
fontID
Integer
The ID number assigned to an Advanced 2D font when it is created.
text
String
This is the text string used to calculate the width value.
Returns the width in pixels of the text string when rendered with Advanced 2D text commands.
This function returns the width in pixels of a text string rendered with Advanced 2D text commands. The returned value includes any whitespace in the text. Note that the value is interpreted using the sizeMode and style values of the font.
myFont1 = a2CreateFont("ariel", 30, a2Size_Char(), a2Style_Normal())
a$ = "Some testy text."
h = a2GetLineHeight(myFont1)
w = a2GetTextWidth(myFont1,a$)
ink 0xFFFF0000,0
box 0,0,w,h
a2Text myFont1,0,0,a$,0xFFFFFFFF
WAIT KEY
a2CreateFont
a2GetLineHeight
Advanced 2D Index
Main Menu
|