… | |
… | |
113 | } |
113 | } |
114 | |
114 | |
115 | sub new_from_ttf { |
115 | sub new_from_ttf { |
116 | my ($class, $ttf, $text) = @_; |
116 | my ($class, $ttf, $text) = @_; |
117 | |
117 | |
118 | utf8::upgrade $text; |
118 | utf8::encode $text; |
119 | |
119 | |
120 | my $surface = SDL::TTFRenderUTF8Blended $ttf, $text, |
120 | my $surface = SDL::TTFRenderUTF8Blended $ttf, $text, |
121 | (new SDL::Color -r => 255, -g => 255, -b => 255); |
121 | (new SDL::Color -r => 255, -g => 255, -b => 255); |
122 | |
122 | |
123 | $class->new_from_surface ($surface) |
123 | $class->new_from_surface (bless \$surface, SDL::Surface::) |
124 | } |
124 | } |
125 | |
125 | |
126 | sub upload { |
126 | sub upload { |
127 | my ($self) = @_; |
127 | my ($self) = @_; |
128 | |
128 | |