- Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathSDLx_text_shadow.pl
31 lines (22 loc) · 807 Bytes
/
SDLx_text_shadow.pl
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
#TODO: shadow, shadow_color, shadow_offset
use strict;
use warnings;
use lib '../lib';
use SDL;
use SDLx::App;
use SDLx::Text;
my$app = SDLx::App->new( eoq=> 1 );
my$normal = SDLx::Text->new;
my$shadow = SDLx::Text->new( shadow=> 1 );
# other variations
my$shadow_off = SDLx::Text->new( shadow=> 1, shadow_offset=> 4 );
my$shadow_color = SDLx::Text->new( shadow=> 1, shadow_color=> [150, 150, 0] );
$app->add_show_handler( sub {
$app->draw_rect( [0, 0, $app->w, $app->h], 0x00ffff );
$normal->write_xy( $app, 10, 0, 'Hello, World!' );
$shadow->write_xy( $app, 10, 50, 'Hello, Shadow!' );
$shadow_off->write_xy( $app, 10, 100, 'Hello, Shadow with offset!' );
$shadow_color->write_xy( $app, 10, 150, 'Hello, colored Shadow!' );
$app->update;
});
$app->run;