Пример #1
0
 public function InitLib()
 {
     // 2. Ming 라이브러리 초기화..
     Ming_setScale(20.0);
     ming_useswfversion(7);
     $this->m_oMovie = new SWFMovie();
     $this->GetImageSize();
     $this->m_oMovie->setDimension($this->m_Width, $this->m_Height);
     $this->m_oMovie->setRate($this->FRAMES);
     $this->m_oMovie->setBackground(255, 255, 255);
 }
Пример #2
0
             $miny = $idy;
         }
         if ($idy > $maxy) {
             $maxy = $idy;
         }
     }
 }
 $widthx = $maxx - $minx;
 $widthy = $maxy - $miny;
 $cellw = 70;
 $cellh = 30;
 $celltmargin = 20;
 $celllmargin = 10;
 $imgwx = $cellw * ($widthx + 2);
 $imgwy = $cellh * ($widthy + 2);
 Ming_setScale(20.0);
 ming_useswfversion(5);
 $m = new SWFMovie();
 $m->setDimension($imgwx, $imgwy);
 $font = new SWFFont("img/Arial.fdb");
 $connections = new SWFShape();
 foreach ($map as $idx => $x) {
     foreach ($x as $idy => $device) {
         $celx = $idx - $minx;
         $cely = $idy - $miny;
         if (preg_match('/^n/', $device)) {
             $device = str_replace('n', '', $device);
             list($nodeid, $device, $linktype) = explode('.', $device);
             $nodemap[$nodeid]['x'] = $celx;
             $nodemap[$nodeid]['y'] = $cely;
             $nodemap[$nodeid]['device'] = $device;
Пример #3
0
<?php

// Scaling
Ming_setScale(20);
srand(time());
// Creates the racket model
$rm = new SWFShape();
$rm->setLine(5, 207, 96, 0);
$rm->drawLineTo(0, 1);
$rm->setLine(5, 255, 200, 0);
$rm->movePenTo(0, 1);
$rm->drawLineTo(0, 50);
// Draws the white line at the middle of the screen
$wl = new SWFShape();
$wl->setLine(8, 255, 255, 255);
$wl->drawLineTo(0, 480);
// Draws the "grass" border
$gm = new SWFShape();
$gm->setLine(100, 48, 96, 48);
$gm->drawLine(640, 0);
// Draws the ball
$bm = new SWFShape();
$bm->setLine(12, 255, 200, 0);
$bm->drawLine(1, 1);
// Creates a font
$f = new SWFFont("arial.fdb");
// Writes the score for player
$sp = new SWFTextField();
$sp->setBounds(100, 30);
$sp->setName("pScore");
$sp->setFont($f);