Permalink
Browse files

text() returns $self, surface() returns $surface

  • Loading branch information...
1 parent 3e92032 commit f00a8eeab32cfbe58bd855f2b8e47d402a6573f6 @garu garu committed Feb 27, 2011
Showing with 10 additions and 2 deletions.
  1. +5 −1 lib/SDLx/Text.pm
  2. +5 −1 lib/pods/SDLx/Text.pod
View
6 lib/SDLx/Text.pm
@@ -82,7 +82,11 @@ sub text {
$self->{w} = $surface->w;
$self->{h} = $surface->h;
- return $surface;
+ return $self;
+}
+
+sub surface {
+ return $_[0]->{surface};
}
sub write_to {
View
6 lib/pods/SDLx/Text.pod
@@ -78,7 +78,11 @@ whatever surface you are placing it into. Available alignments are 'C<left>',
=head2 text( "text to write" )
-Sets the text to be displayed by the SDLx::Text object.
+Sets the text to be displayed by the SDLx::Text object. Return the SDLx::Text object itself, so you can easily chain this method around.
+
+=head2 surface
+
+Returns the underlying surface representing the text itself. You probably don't need this, unless you're doing something really funky.
=head2 write_to( $target_surface )

0 comments on commit f00a8ee

Please sign in to comment.