Ejemplo n.º 1
0
function drawtext($x, $y, $text, $r, $g, $b)
{
    global $m, $font;
    if (!$text) {
        return;
    }
    // remove special characters because we haven't got proper font
    // or something else. I don't know why, but we have a problem with
    // that characters on flash map.
    $text = clear_utf($text);
    $t = new SWFTextField(SWFTEXTFIELD_NOEDIT | SWFTEXTFIELD_NOSELECT);
    $t->setFont($font);
    $t->setHeight(8);
    $t->setColor($r, $g, $b);
    $t->addString($text);
    $i = $m->add($t);
    $i->moveTo($x, $y);
}
Ejemplo n.º 2
0
 /**
  * Render text depending of font type and available font extensions
  * 
  * @param string $id 
  * @param string $text 
  * @param string $chars 
  * @param int $type 
  * @param string $path 
  * @param ezcGraphColor $color 
  * @param ezcGraphCoordinate $position 
  * @param float $size 
  * @param float $rotation 
  * @return void
  */
 protected function renderText($id, $text, $chars, $type, $path, ezcGraphColor $color, ezcGraphCoordinate $position, $size, $rotation = null)
 {
     $movie = $this->getDocument();
     $tb = new SWFTextField(SWFTEXTFIELD_NOEDIT);
     $tb->setFont(new SWFFont($path));
     $tb->setHeight($size);
     $tb->setColor($color->red, $color->green, $color->blue, 255 - $color->alpha);
     $tb->addString($text);
     $tb->addChars($chars);
     $object = $movie->add($tb);
     $object->rotate($rotation !== null ? -$rotation->getRotation() : 0);
     $object->moveTo($position->x + ($rotation === null ? 0 : $this->modifyCoordinate($rotation->get(0, 2))), $position->y - $size * (1 + $this->options->lineSpacing) + ($rotation === null ? 0 : $this->modifyCoordinate($rotation->get(1, 2))));
     $object->setName($id);
 }
Ejemplo n.º 3
0
            $f = new SWFFont($objs[$coid]->font);
            $t->setFont($f);
            $t->setHeight(flash_fixsize($objs[$coid]->titleSize));
            $t->addString($objs[$coid]->title);
            $i = $m->add($t);
            if ($in == 0) {
                $i->moveTo(5, 0);
            }
        }
        foreach ($el['text'] as $in => $val) {
            if (!empty($el['text'][$in]['data'])) {
                $t = new SWFTextField();
                $t->setColor($defaultColor[0], $defaultColor[1], $defaultColor[2]);
                $t->align(SWFTEXTFIELD_ALIGN_LEFT);
                $t->setFont($f);
                $t->setHeight((int) ($_GET['h'] / 5));
                $t->addString($el['text'][$in]['data']);
                $i = $m->add($t);
                if ($in == 0) {
                    $i->moveTo(15, 5);
                }
            }
        }
        break;
}
header('Content-type: application/x-shockwave-flash');
$m->output();
function rgb($rgb)
{
    if (strlen($rgb) == 6) {
        $r = hexdec(substr($rgb, 0, 2));
Ejemplo n.º 4
0
#!/usr/bin/php -c.

<?php 
$srcdir = $argv[1];
$mediadir = $srcdir . "/../Media";
$m = new SWFMovie();
$f = new SWFFont($mediadir . "/font01.fdb");
$t = new SWFText(1);
$t->setFont($f);
$t->setHeight(20);
$t->setColor(0x0, 0x0, 0xff);
$t->moveTo(100, 100);
$t->addString("Static Text");
$tf = new SWFTextField(SWFTEXTFIELD_NOEDIT);
$tf->setFont($f);
$tf->setHeight(20);
$tf->setColor(0xff, 0x0, 0x0);
$tf->addString("Readonly Textfield");
$m->add($t);
$it = $m->add($tf);
$it->moveTo(100, 120);
$m->nextFrame();
/* end of frame 1 */
$m->save("test05.swf");
             $name = $symbol_pointers['name'][$i];
             $id = $symbol_pointers['equipment_type_id'][$i];
             $equipment_type_image_id = $symbol_pointers['equipment_type_image_id'][$i];
             //$mfile = $path."/usr/".$account_id."/merchandising/" . $filename;
             $mfile = $filename;
             $source_file = new SWFBitmap(fopen($mfile, 'r'));
             $icon_id = "icon_" . $id;
             $my_y_pos = 25 + 22 * $i;
             $container = new SWFSprite();
             $container->add($source_file);
             $container->nextFrame();
             $m->addExport($container, $icon_id);
             $icon_as .= "Object.registerClass('{$icon_id}', createIcon);\n\t\t\tattachMovie('{$icon_id}','bitmap_{$icon_id}',1,\n\t\t\t\t{_y:{$my_y_pos},equipment_type_symbol:'equipment_type_{$icon_id}',equipment_type_id:{$id},equipment_type_image_id:'{$equipment_type_image_id}'});\n\t\t\t";
             $kt = new SWFTextField();
             $kt->setFont($f);
             $kt->setHeight(11);
             $kt->setBounds(170, 25);
             $kt->addString("{$name}");
             $kt2 = $entire_key->add($kt);
             $kt2->moveto(37, 11 + $my_y_pos);
             unset($container);
         }
     }
 }
 unset($kt);
 unset($kt2);
 unset($name);
 unset($symbol_pointers);
 if ($_GET['key'] == 'yes' || $_GET['key'] == '') {
     $entire_key->nextFrame();
     $i = $m->add($entire_key);