Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit f00a8eeab32cfbe58bd855f2b8e47d402a6573f6 1 parent 3e92032
Breno G. de Oliveira garu authored
Showing with 10 additions and 2 deletions.
  1. +5 −1 lib/SDLx/Text.pm
  2. +5 −1 lib/pods/SDLx/Text.pod
6 lib/SDLx/Text.pm
View
@@ -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 {
6 lib/pods/SDLx/Text.pod
View
@@ -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 )
Please sign in to comment.
Something went wrong with that request. Please try again.