/,_/ '`-' EOT; $canvas = new Canvas(); if (!$canvas) { die("Error while creating main canvas\n"); } $pig = new Canvas(); if (!$pig) { die("Error while creating canvas pig\n"); } $display = new Display($canvas); if (!$display) { die("Error while attaching canvas to display\n"); } $pig->setColorANSI(AnsiColor::LIGHTMAGENTA, AnsiColor::TRANSPARENT); $pig->importString($pig_str, "text"); $display->setDisplayTime(20000); $x = $y = 0; $ix = $iy = 1; while (!$display->getEvent(EventType::KEY_PRESS)) { // In case of resize ... if ($x + $pig->getWidth() - 1 >= $canvas->getWidth() || $x < 0) { $x = 0; } if ($y + $pig->getHeight() - 1 >= $canvas->getHeight() || $y < 0) { $y = 0; } $canvas->Clear(); // Draw $canvas->Blit($x, $y, $pig, NULL); $canvas->setColorANSI(AnsiColor::LIGHTBLUE, AnsiColor::BLACK);