Hey folks,
I've just started learning Perl/Tk (Whoa, is that cool... A GUI? Who'd a thunk it) and am starting by attempting to make a simple old-school RPG like game.
My very first exercise was to draw a couple of tiles (walls/floor/empty space) and then have Perl/Tk stick them into a window to form the floorplan.
After a bit of trial-and-error, I have some semi-working code, but from somewhere there is some padding appearing (about 5 pixels or so) around my tiles, making a rather nice griddle effect, that somewhat breaks up whats supposed to be a continuous floorplan.
The manpage says the padding defaults to 0 (I also specifically told it to pad 0, to no effect) and I can't seem to find anything in the POD, or my Advanced Perl Programming (which only VERY lightly touches on the grid manager) as to explain this padding.
Don't suppose anyone could be a champ and point out what I'm doing wrong, or what I'm not supplying?
my $MW = Tk::MainWindow->new;
my (@pl) = qw/-side top -expand yes -padx 10 -pady 10 -fill both/;
my $frame = $MW->Frame->pack(@pl);
my $canvas = $frame->Canvas(-width => 320, -height => 320)->grid;
for(my $x = 0; $x <= 9; $x++) {
for(my $y = 0; $y <= 9; $y++) {
my $ttile = $MW->Photo(-file => "./tiles/brick.xpm");
my $label = $canvas->Label(-image => $ttile, -height => 32,
-width => 32)
->grid(-row => $x, -col => $y);
}
}
$canvas->update;
MainLoop;
JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --