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).
La clase SWFText
(No hay información de versión disponible, podría estar únicamente en SVN)
Introducción
SWFText.
Sinopsis de la Clase
Tabla de contenidos
- SWFText::addString — Dibuja una string
- SWFText::addUTF8String — Escribe el texto dado en este objeto SWFText en la posición actual de la pluma, usando la fuente, alto, espaciado y color actuales
- SWFText::__construct — Crea un nuevo objeto SWFText
- SWFText::getAscent — Devuelve el ascenso de la fuente actual en su tamaño actual, o 0 si no está disponible
- SWFText::getDescent — Devuelve el descenso de la fuente actual en su tamaño actual, o 0 si no está disponible
- SWFText::getLeading — Devuelve el interlineado de la funete actual en su tamaño actual, o 0 si no está disponible
- SWFText::getUTF8Width — Calcula el ancho de la cadena dada de la fuente y tamaño actuales de este objeto texto
- SWFText::getWidth — Computa el ancho de una cadena
- SWFText::moveTo — Mueve la pluma
- SWFText::setColor — Establece el color de texto actual
- SWFText::setFont — Establece la fuente actual
- SWFText::setHeight — Establece el alto de fuente actual
- SWFText::setSpacing — Establece el espaciado de fuente
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.
