Ignore:
Timestamp:
Oct 26, 2008, 1:52:06 AM (14 years ago)
Author:
nico
Message:
  • Add a nice label with libcaca's version in the center of the screen in sample program examples/example1.php
File:
1 edited

Legend:

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

    r3105 r3106  
    3636
    3737caca_set_color_ansi($pig, CACA_LIGHTMAGENTA, CACA_TRANSPARENT);
     38caca_set_color_ansi($canvas, CACA_LIGHTBLUE, CACA_TRANSPARENT);
    3839caca_import_memory($pig, $pig_str, "text");
    3940caca_set_display_time($display, 30000);
     
    5152        caca_clear_canvas($canvas);
    5253
    53         // Draw pig
     54        // Draw
    5455        caca_blit($canvas, $x, $y, $pig);
     56        caca_put_str($canvas, caca_get_canvas_width($canvas) / 2 - 10, caca_get_canvas_height($canvas) / 2, "Powered by libcaca ".caca_get_version());
    5557        caca_refresh_display($display);
    5658
     59
     60        // Move cursor
    5761        $x += $ix;
    5862        $y += $iy;
    59 
    6063        if ($x + caca_get_canvas_width($pig) >= caca_get_canvas_width($canvas) || $x < 0 )
    6164                $ix = -$ix;
Note: See TracChangeset for help on using the changeset viewer.