/lib/SDLx/SFont.pm

http://github.com/PerlGameDev/SDL · Perl · 28 lines · 21 code · 7 blank · 0 comment · 0 complexity · e78be94b775378404ff7b03390ea6d8a MD5 · raw file

  1. package SDLx::SFont;
  2. use strict;
  3. use warnings;
  4. use SDL::Image;
  5. use vars qw(@ISA @EXPORT @EXPORT_OK);
  6. require Exporter;
  7. require DynaLoader;
  8. use SDL::Constants ':SDL::TTF';
  9. our @ISA = qw(Exporter DynaLoader SDL::Surface);
  10. use base 'Exporter';
  11. our @EXPORT = ('SDL_TEXTWIDTH');
  12. our $VERSION = 2.548;
  13. sub SDL_TEXTWIDTH {
  14. return SDLx::SFont::TextWidth( join( '', @_ ) );
  15. }
  16. sub print_text { #print is a horrible name for this
  17. my ( $surf, $x, $y, @text ) = @_;
  18. SDLx::SFont::print_string( $surf, $x, $y, join( '', @text ) );
  19. }
  20. bootstrap SDLx::SFont;
  21. 1;