Ignore:
Timestamp:
Nov 5, 2008, 2:00:38 AM (12 years ago)
Author:
bsittler
Message:

add a Libcaca class to the PHP class interface, parallel to the Libcaca class in the .NET interface; fix a bunch of whitespace inconsistencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/test.php

    r3292 r3293  
    66   *
    77   *  This file is a Php port of "caca-sharp/test.cs"
    8    *  which is: 
     8   *  which is:
    99   *  Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>
    1010   *                2007 Sam Hocevar <sam@zoy.org>
     
    6969                {
    7070                        $v = ((sin(($t / 500.0)
    71                                         + (1.0 * $i / $barCount)) + 1) / 2) * $this->getHeight();
     71                                           + (1.0 * $i / $barCount)) + 1) / 2) * $this->getHeight();
    7272                        $p1_x = 0; $p1_y = intval($v);
    7373                        $p2_x = $this->getWidth() - 1; $p2_y = intval($v);
     
    8888                $this->d->bitmap($this, - $x, $h / 2 - $y, $w * 12, $y * 2);
    8989                $this->d->bitmap($this, 12 * $w - $x, $h / 2 - $y, $w * 12, $y * 2);
    90  
     90
    9191                $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLUE);
    9292                $this->putStr($this->getWidth() - 30, $this->getHeight() - 2, " -=[ Powered by libcaca ]=- ");
     
    127127        static function Main()
    128128        {
    129                 printf("libcaca %s PHP test\n", caca_get_version());
     129                printf("libcaca %s PHP test\n", Libcaca::getVersion());
    130130                printf("(c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org>\n");
    131131                printf("(c) 2007 Sam Hocevar <sam@zoy.org>\n");
     
    139139
    140140                /* Random number. This is a static method,
    141                 not to be used with previous instance */
    142                 printf("A random number: %d\n", caca_rand(0, 1337));
     141                 not to be used with previous instance */
     142                printf("A random number: %d\n", Libcaca::Rand(0, 1337));
    143143
    144144                $dp->EventLoop();
Note: See TracChangeset for help on using the changeset viewer.