X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-TTF.html-inc;fp=pages%2FSDL-TTF.html-inc;h=2602f6d1e1ba18db5141c453f7717e437efecaa1;hb=c7e8d3c612049580c9a96b3006c4c89a00410643;hp=29189a2642a6a29dff403e352a63f11186e2d90d;hpb=285d0cd289790209bcd9d141d63fd6fce74a2ee4;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-TTF.html-inc b/pages/SDL-TTF.html-inc index 29189a2..2602f6d 100644 --- a/pages/SDL-TTF.html-inc +++ b/pages/SDL-TTF.html-inc @@ -93,7 +93,7 @@ -
The constants are exported by default. You can avoid this by doing:
use SDL::TTF (); - - -
and access them directly:
SDL::TTF::TTF_HINTING_NORMAL; @@ -627,22 +624,22 @@ is done to get the actual width. The height returned in h is the same as you canNote: See space-character bug. You have to upgrade libfreetype2 to at least version 2.3.5
Example:
-use SDL; - use SDL::Rect; - use SDL::Video; - use SDL::Color; - use SDL::TTF; - use SDL::TTF::Font; +use SDL; + use SDL::Rect; + use SDL::Video; + use SDL::Color; + use SDL::TTF; + use SDL::TTF::Font; - SDL::init(SDL_INIT_VIDEO); - SDL::TTF::init(); - my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE); - my $font = SDL::TTF::open_font('test/data/aircut3.ttf', '24'); - die 'Coudnt make font '. SDL::get_error if !$font; - my $surface = SDL::TTF::render_text_solid($font, 'Hallo!', SDL::Color->new(0xFF,0xFF,0xFF)); - SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480)); - SDL::Video::update_rect($display, 0, 0, 0, 0); - SDL::delay(5000); + SDL::init(SDL_INIT_VIDEO); + SDL::TTF::init(); + my $display = SDL::Video::set_video_mode(640, 480, 32, SDL_SWSURFACE); + my $font = SDL::TTF::open_font('test/data/aircut3.ttf', '24'); + die 'Coudnt make font '. SDL::get_error if !$font; + my $surface = SDL::TTF::render_text_solid($font, 'Hallo!', SDL::Color->new(0xFF,0xFF,0xFF)); + SDL::Video::blit_surface($surface, SDL::Rect->new(0, 0, 640, 480), $display, SDL::Rect->new(10, 10, 640, 480)); + SDL::Video::update_rect($display, 0, 0, 0, 0); + SDL::delay(5000);@@ -792,9 +789,9 @@ your display-surface.Note: The unicode char has to be passed exactly like for SDL::TTF::size_unicode.
-AUTHOR
-