Example #1
0
 /**
  * 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");
 }
Example #2
0
 public function testIsCli()
 {
     $this->assertTrue(Console::isCli());
 }