ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/image.pl
Revision: 1.1
Committed: Sat May 31 09:46:51 2003 UTC (21 years ago) by pcg
Content type: text/plain
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 package image;
2    
3     sub load_img {
4     new_from_file Gtk2::Gdk::Pixbuf "$::IMGDIR/$_[0]"
5     # load_image Gtk2::Gdk::ImlibImage "$::IMGDIR/$_[0]"
6     or die "$::IMGDIR/$_[0]: $!";
7     }
8    
9     my @fontchars = ('A' .. 'Z', 0 .. 9);
10    
11     @::black_img = load_img "b-01.png";
12     @::white_img = map +(load_img "w-0$_.png"), 1,2,3,4,5;
13     @::triangle_img = map +(load_img "triangle-$_.png"), qw(b w);
14     @::square_img = map +(load_img "square-$_.png"), qw(b w);
15     @::circle_img = map +(load_img "circle-$_.png"), qw(b w);
16     $::board_img = load_img "woodgrain-01.jpg";
17    
18     @::font = (
19     [map +(load_img "font/$_-black.png"), @fontchars],
20     [map +(load_img "font/$_-white.png"), @fontchars],
21     );
22     %::fontmap;
23     @::fontmap{@fontchars} = (0..25 + 10);
24     @::fontmap{'a' .. 'z'} = (0..25);
25    
26     1;
27