Thread SDL - bei Mausklick etwas malen (1 answers)
Opened by pktm at 2008-11-09 00:54

pktm
 2008-11-09 01:04
#116118 #116118
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Hui, ich bin schlauer...

Code: (dl )
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
sub mousebuttondown {
my $self = shift;
my $event = shift;
my $app = $self->app();

say "mousebutton";
say '<' . $event->button_x() . ',' . $event->button_x() . '>';

my $r_width = 10;
my $r_height = 10;
my $rect = SDL::Rect->new(
-height => $r_height,
-width => $r_width,
-x => $event->button_x() - $r_width/2,
-y => $event->button_y() - $r_height/2,
);

my $color = SDL::Color->new(
-r => 0x00,
-g => 0x00,
-b => 0xff,
);

$app->fill( $rect, $color );

$app->update( $rect );

} # /mousebuttondown


Jetzt nurnoch bewegen...
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread SDL - bei Mausklick etwas malen