a note to add to p_smiecho at interia dot pl's post:
when you do a $movie->add($t); it will return a SWFDisplayItem which can then be moved so your code can be simplified to this:
<?php
$f = new SWFFont('Arial');
$t = new SWFTextField();
$t -> setFont($f);
$t -> addString('Hello world!!!');
$m = new SWFMovie();
...
$ttwo=$m->add($t);
$ttwo->moveTo(300, 300);
?>
(on a windows box running Ming .2)
La classe SWFText
Introduction
SWFText.
Synopsis de la classe
SWFText
SWFText
{
/* Méthodes */
void addString
( string $string
)
void addUTF8String
( string $text
)
void __construct
( void
)
float getAscent
( void
)
float getDescent
( void
)
float getLeading
( void
)
float getUTF8Width
( string $string
)
float getWidth
( string $string
)
void moveTo
( float $x
, float $y
)
void setColor
( int $red
, int $green
, int $blue
[, int $a
] )
void setHeight
( float $height
)
void setSpacing
( float $spacing
)
}Sommaire
- SWFText->addString — Dessine une chaîne de caractères
- SWFText->addUTF8String — Écrit le texte donné dans l'objet SWFText à la position courante, en utilisant la police, la haute, l'espacement et la couleur courants
- SWFText->__construct — Crée un nouvel objet SWFText
- SWFText->getAscent — Retourne la montée de la police courante à sa taille courante, ou 0 si elle n'est pas disponible
- SWFText->getDescent — Retourne la descente de la police courante à sa taille courante, ou 0 si elle n'est pas disponible
- SWFText->getLeading — Retourne l'interlignage de la police courante à sa taille courante, ou 0 s'il n'est pas disponible
- SWFText->getUTF8Width — Calcule la largeur de la chaîne donnée dans la police et la taille courante du texte
- SWFText->getWidth — Calcule la largeur d'une chaîne
- SWFText->moveTo — Déplace le stylo
- SWFText->setColor — Définit la couleur courante du texte
- SWFText->setFont — Définit la police courante
- SWFText->setHeight — Définit la hauteur de la police courante
- SWFText->setSpacing — Définit l'espacement de la police courante
SWFText
samrerb at gmail dot com
01-Aug-2006 08:19
01-Aug-2006 08:19
p_smiecho at interia dot pl
01-Dec-2003 03:26
01-Dec-2003 03:26
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).
franky at boucheros dot com
22-Apr-2002 06:12
22-Apr-2002 06:12
For windows platform :
<?php
$f=new SWFFont("_sans");
$t=new SWFTextField();
?>
and comment the moveto line.
