Changeset 3104 for libcaca/trunk/caca-php/examples
- Timestamp:
- Oct 25, 2008, 5:41:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca-php/examples/example1.php
r3101 r3104 2 2 <? 3 3 4 echo caca_put_str()."\n"; 4 $pig_str = <<<EOT 5 6 _._ _..._ .-', _.._(`)) 7 '-. ` ' /-._.-' ',/ 8 ) \ '. 9 / _ _ | \ 10 | a a / PHP | 11 \ .-. ; 12 '-('' ).-' ,' ; 13 '-; | .' 14 \ \ / 15 | 7 .__ _.-\ \ 16 | | | ``/ /` / 17 jgs /,_| | /,_/ / 18 /,_/ '`-' 19 EOT; 20 21 $canvas = caca_create_canvas(0, 0); 22 if (!$canvas) { 23 die("Error while creating main canvas\n"); 24 } 25 26 $pig = caca_create_canvas(0, 0); 27 if (!$pig) { 28 die("Error while creating canvas pig\n"); 29 } 30 31 $display = caca_create_display($canvas); 32 if (!$display) { 33 die("Error while attaching canvas to display\n"); 34 } 35 36 37 caca_set_color_ansi($pig, CACA_LIGHTRED, CACA_WHITE); 38 caca_import_memory($pig, $pig_str, "text"); 39 caca_blit($canvas, caca_get_canvas_width($canvas) / 2 - 20, caca_get_canvas_height($canvas) /2 - 7, $pig); 40 caca_refresh_display($display); 41 42 sleep(5); 43 44
Note: See TracChangeset
for help on using the changeset viewer.