# would be another call and rects are a time-critical object.
sub left {
my $self = shift;
- RectX($self,@_);
+ return RectX($self,@_);
}
sub x {
my $self = shift;
- RectX($self,@_);
+ return RectX($self,@_);
}
### TODO: see 'left' above (this is an 'alias' to sub y)
sub top {
my $self = shift;
- RectY($self,@_);
+ return RectY($self,@_);
}
sub y {
my $self = shift;
- RectY($self,@_);
+ return RectY($self,@_);
}
### TODO: see 'left' above (this is an 'alias' to sub width)
sub w {
my $self = shift;
- RectW($self,@_);
+ return RectW($self,@_);
}
sub width {
my $self = shift;
- RectW($self,@_);
+ return RectW($self,@_);
}
### TODO: see 'left' above (this is an 'alias' to sub height)
sub h {
my $self = shift;
- RectH($self,@_);
+ return RectH($self,@_);
}
sub height {
my $self = shift;
- RectH($self,@_);
+ return RectH($self,@_);
}
use strict;
use SDL;
use SDL::Config;
-#use SDL::Rect;
+use SDL::Rect;
use SDL::Game::Rect;
use SDL::Color;
use Test::More;
my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO);
- my $rect = SDL::Game::Rect->new( 0,0, 10, 20);
+ my $rect = SDL::Rect->new( 0,0, 10, 20);
my $blue = SDL::Color->new(
-r => 0x00,
my $grect = SDL::Game::Rect->new(10, 10, 30, 5);
+ foreach(0..20)
+ {
+ print $_;
+ $rect->x($_);
+ $grect->x($_);
$app->fill($rect, $blue);
$app->fill($grect, $col);
+
+
$app->update($rect);
$app->update($grect);
+ $app->sync;
+ }
- $app->sync;
sleep(1);