Skip to content
This repository
Browse code

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

  • Loading branch information...
commit f00a8eeab32cfbe58bd855f2b8e47d402a6573f6 1 parent 3e92032
Breno G. de Oliveira garu authored

Showing 2 changed files with 10 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 1 lib/SDLx/Text.pm
  2. +5 1 lib/pods/SDLx/Text.pod
6 lib/SDLx/Text.pm
@@ -82,7 +82,11 @@ sub text {
82 82 $self->{w} = $surface->w;
83 83 $self->{h} = $surface->h;
84 84
85   - return $surface;
  85 + return $self;
  86 +}
  87 +
  88 +sub surface {
  89 + return $_[0]->{surface};
86 90 }
87 91
88 92 sub write_to {
6 lib/pods/SDLx/Text.pod
Source Rendered
@@ -78,7 +78,11 @@ whatever surface you are placing it into. Available alignments are 'C<left>',
78 78
79 79 =head2 text( "text to write" )
80 80
81   -Sets the text to be displayed by the SDLx::Text object.
  81 +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.
  82 +
  83 +=head2 surface
  84 +
  85 +Returns the underlying surface representing the text itself. You probably don't need this, unless you're doing something really funky.
82 86
83 87 =head2 write_to( $target_surface )
84 88

0 comments on commit f00a8ee

Please sign in to comment.
Something went wrong with that request. Please try again.