SWFText : SWFCharacter


SWFText SWFText();

Constructor. Create a new text object, fresh for manipulatin'.


void setFont(SWFFont font);
void Font;

Set the current font to font.


void SWFBlock getBlock();
void Block;

Get SWFBlock object.


void setHeight(float height);
void Height;

Set the current font height to height. Default is 240.


void setXY(float x, float y); Deprecated
void moveTo(float x, float y);

Move the pen (or cursor, if that makes more sense) to (x,y) in text object's coordinate space. If either is zero, though, value in that dimension stays the same. Annoying, should be fixed.


void setColor(int r, int g, int b [, int a]);
Change the current text color. Default is black. I think.


void addString(string s[, int advance]);
Draw the string string at the current pen (cursor) location. Pen is at the baseline of the text; i.e., ascending text is in the -y direction.


void setSpacing(float spacing);
Set the current font spacing to spacing. Default is 1.0. 0 is all of the letters written at the same point. This doesn't really work that well because it inflates the advance across the letter, doesn't add the same amount of spacing between the letters. I should try and explain that better, prolly. Or just fix the damn thing to do constant spacing. This was really just a way to figure out how letter advances work, anyway.. So nyah.


float getWidth(string s);
float getStringWidth(string s);

Returns the rendered width of the given string at the text object's current font, scale, and spacing settings.


float getAscent();
Returns the Ascent of text.


float getDescent();
Returns the Descent of text.


float getLeading();
Returns the Leading of text.


back to index