|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| SDL & Fonts Part 2: PrintStrings |
|
![]() d0hboy Member since: 2/19/2002 |
||||
|
|
||||
| Excellent article, it cleared up quite a few issues which I was thinking about. One alternative had me trying to code a recursive algorithm to split the line and redraw the clipped text onto the next line until the remaining text fit within my box. Your method is much easier and conceptually a lot simpler. |
||||
|
||||
![]() TekkamanEndless Member since: 6/27/2002 |
||||
|
|
||||
| Well, I'm glad that I could be of help. The SDL_Rect parameter in PrintStrings() was also going to be for text wrapping as well as position, but I never needed it, so I left it out. I'd be glad to help write a wrapping function if you get stuck (I'm sure I'll need one sometime |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Does this work on Linux? |
||||
|
||||
![]() TekkamanEndless Member since: 6/27/2002 |
||||
|
|
||||
| SDL_TTF is, as far as I know, compatible with Linux. I think that you have to do some extra, weird stuff with FreeType that involves compiling it *as well as* SDL_TTF (Windows users just grab a big library). But if you can get SDL_TTF working, this should work just fine. I don't have any Linux boxes with SDL on them yet, so can I get a second opinion, please |
||||
|
||||
![]() parky1 Member since: 2/3/2004 |
||||
|
|
||||
| Excellent article! I have, however, managed to create a problem. I have been using the suggested "helper" functions by including them in a separate header file - this had been working fine for some time but now I get: Main.obj : error LNK2005: "struct SDL_Rect __cdecl newSDL_Rect(int,int,int,int)" (?newSDL_Rect@@YA?AUSDL_Rect@@HHHH@Z) already defined in Graphics.obj I get an error line such as this one for each function in the helper file, newSDL_Rect, newSDL_Color etc. and I don't know what I have done to invoke this problem. I have include guards on all of my header files. Can anybody help? Thanks. |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|