SWFText


$t = new SWFText();
t = SWFText()
SWFText *t = new SWFText();
SWFText t = newSWFText();

Create a new text object, fresh for manipulatin'.


$t->setFont($font);
t.setFont(font)
t->setFont(font);
SWFText_setFont(t, font);
Set the current font to font.


$t->setHeight($height);
t.setHeight(height)
t->setHeight(height);
SWFText_setHeight(t, height);
Set the current font height to height. Default is 240.


$t->setSpacing($spacing);
t.setSpacing(spacing)
t->setSpacing(spacing);
SWFText_setSpacing(t, 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.


$t->setColor($r, $g, $b [, $a]);
t.setColor(r, g, b [, a])
t->setColor(r, g, b [, a]);
SWFText_setColor(t, r, g, b, a);
Change the current text color. Default is black. I think.


$t->moveTo($x, $y);
t.moveTo(x, y)
t->moveTo(x, y);
SWFText_moveTo(t, x, 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.


$t->addString($string);
t.addString(string)
t->addString(string);
SWFText_addString(string);
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.


$width = $t->getWidth($string);
width = t.getWidth(string)
width = t->getWidth(string);
width = SWFText_getStringWidth(t, string);
Returns the rendered width of the given string at the text object's current font, scale, and spacing settings.


Text example

back to index


All content Copyright (C) 2000-2002 Opaque Industries except where noted otherwise.