It seems to me that there is a bug: everything works perfect but only with Linux. SWFText crashes while working on Windows. So I do it that way:
<?php
$f = new SWFFont('Arial');
$t = new SWFTextField();
$t -> setFont($f);
$t -> addString('Hello world!!!');
$p = new SWFSprite();
$i = $p -> add($t);
$i -> moveto(100, 100); // Here you can move text !!
//$p -> remove($i);
$m = new SWFMovie();
// ...
$m -> add($p);
?>
Of course it writes text where I want, but I still can't get other methods of SWFText class. For example: I can't get text width (swftext->getwidth).
SWFText クラス
目次
- SWFText::addString — 文字列を描画する
- SWFText::addUTF8String — 現在のペンの位置に、現在のフォント・高さ・行間および色設定を使用して 指定したテキストで SWFText オブジェクトを作成する
- SWFText::__construct — 新しい SWFText オブジェクトを作成する
- SWFText::getAscent — 現在のサイズにおけるフォントの ascent (ベースライン上部の高さ) あるいは取得できない場合は 0 を返す
- SWFText::getDescent — 現在のサイズにおけるフォントの descent (ベースライン下部の深さ) あるいは取得できない場合は 0 を返す
- SWFText::getLeading — 現在のサイズにおけるフォントの leading (行間) あるいは取得できない場合は 0 を返す
- SWFText::getUTF8Width — 現在のフォントおよびサイズにおける指定した文字列の幅を計算する
- SWFText::getWidth — 文字列の幅を計算する
- SWFText::moveTo — ペンを移動する
- SWFText::setColor — 現在のテキスト色を設定する
- SWFText::setFont — 現在のフォントを設定する
- SWFText::setHeight — 現在のフォントの高さを設定する
- SWFText::setSpacing — 現在のフォントの間隔を設定する
p_smiecho at interia dot pl ¶
9 years ago
franky at boucheros dot com ¶
11 years ago
For windows platform :
<?php
$f=new SWFFont("_sans");
$t=new SWFTextField();
?>
and comment the moveto line.
