コード例 #1
0
ファイル: Sprite.php プロジェクト: robotdance/php-console
 /**
  * Displays animation on screen
  */
 public function animate()
 {
     for ($time = 0; $time <= $this->meta['t']; $time += $this->meta['f']) {
         foreach ($this->frames as $frame) {
             fwrite(STDOUT, $frame);
             $this->sleepMilli($this->meta['f']);
             Console::moveCursorRel(-$this->meta['w'], -$this->meta['h']);
             $time += $this->meta['f'];
             // necessary, dont mess
         }
     }
     Console::moveCursorRel($this->meta['w'], $this->meta['h']);
     fwrite(STDOUT, "\n");
 }
コード例 #2
0
 public function testIsCli()
 {
     $this->assertTrue(Console::isCli());
 }