The SWFText class
Введение
SWFText.
Class synopsis
SWFText
class SWFText
{
/* Methods */
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
( int $x
, int $y
)
void setColor
( int $red
, int $green
, int $blue
[, int $a
] )
void setFont
( string $font
)
void setHeight
( int $height
)
void setSpacing
( float $spacing
)
}Содержание
- SWFText->addString() — Draws a string
- SWFText->addUTF8String() — Writes the given text into this SWFText object at the current pen position, using the current font, height, spacing, and color
- SWFText->__construct() — Creates a new SWFText object
- SWFText->getAscent() — Returns the ascent of the current font at its current size, or 0 if not available
- SWFText->getDescent() — Returns the descent of the current font at its current size, or 0 if not available
- SWFText->getLeading() — Returns the leading of the current font at its current size, or 0 if not available
- SWFText->getUTF8Width() — calculates the width of the given string in this text objects current font and size
- SWFText->getWidth() — Computes string's width
- SWFText->moveTo() — Moves the pen
- SWFText->setColor() — Sets the current text color
- SWFText->setFont() — Sets the current font
- SWFText->setHeight() — Sets the current font height
- SWFText->setSpacing() — Sets the current font spacing
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Генерация нетекстовых MIME форматов
- Введение
- Установка и настройка
- Предопределенные константы
- Примеры
- Ming Функции
- The SWFAction class
- The SWFBitmap class
- The SWFButton class
- The SWFDisplayItem class
- The SWFFill class
- The SWFFont class
- The SWFFontChar class
- The SWFGradient class
- The SWFMorph class
- The SWFMovie class
- The SWFPrebuiltClip class
- The SWFShape class
- The SWFSound class
- The SWFSoundInstance class
- The SWFSprite class
- The SWFText class
- The SWFTextField class
- The SWFVideoStream class
Коментарии
For windows platform :
<?php
$f=new SWFFont("_sans");
$t=new SWFTextField();
?>
and comment the moveto line.
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).