Browse files

allowing you to set empty/undef text in write_to() and write_xy()

  • Loading branch information...
1 parent 01b8dd7 commit 1cceb791c8caee77ce7cc59a7f166fdefcc90fe1 @garu garu committed Mar 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/SDLx/Text.pm
View
4 lib/SDLx/Text.pm
@@ -148,7 +148,7 @@ sub surface {
sub write_to {
my ($self, $target, $text) = @_;
- $self->text($text) if $text;
+ $self->text($text) if scalar @_ > 2;
if ( my $surface = $self->{surface} ) {
if ($self->{h_align} eq 'center' ) {
$self->{x} = ($target->w / 2) - ($surface->w / 2);
@@ -166,7 +166,7 @@ sub write_to {
sub write_xy {
my ($self, $target, $x, $y, $text) = @_;
- $self->text($text) if $text;
+ $self->text($text) if scalar @_ > 4;
if ( my $surface = $self->{surface} ) {
SDL::Video::blit_surface(

0 comments on commit 1cceb79

Please sign in to comment.