Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 36 lines (23 sloc) 0.817 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
use SDL;
use SDLx::App;
use SDLx::Sprite;

my $app = SDLx::App->new( w => 500, h => 500, d => 32, title => 'Pretty Flowers' );

# Draw Code Starts here

my $flower = SDLx::Sprite->new ( width => 50, height => 100 );

$flower->surface->draw_rect ( [0,0,50,100], [0,0,0,0] );

$flower->surface->draw_rect ( [23,30, 4, 100], [0,255,0,255] );
$flower->surface->draw_circle_filled ( [25,25], 10, [150,0,0,255] );
$flower->surface->draw_circle ( [25,25], 10, [255,0,0,255] );
$flower->alpha_key( 0 );

$app->draw_rect( [0,0,500,500], [20,50,170, 255] );

$app->draw_rect( [0,400,500,100], [50,170,20,100] );

foreach( 0..500 )
{
my $y = 425 - rand( 50 );
$flower->draw_xy( $app, rand(500)-20, $y );
}

#Draw Code Ends Here

$app->update();

require SDL::Video;

SDL::Video::save_BMP( $app, 'flower.bmp');

sleep(2);
Something went wrong with that request. Please try again.