   sdl & text width
  Hi all , i have a simple question to ask about sdl.I've got this code:Quote:int px,py=0;  px = 100;  py = 220;   message = TTF_RenderText_Blended(font_name, "text text text -.- -.- ..023adasdadasdadadasddasdasad", txt_col ); if( message == NULL ){return 1;} else {UPDATE_POSITION( px, py, message, screen );}The problem with the above code is that my text message's widthis greater than the window's client width and it doesnt displays thetext in the right order.What i want , is a function(maybe?) that can get the width of my text object.I know the math formula , wich is:x = (SCREEN WIDTH /  2) - (TEXT OBJECT WIDTH / 2)&y = (SCREEN HEIGHT /  2) - (TEXT OBJECT HEIGHT / 2)but i dont know how to get the text object's width.Any ideas??   
  Look up TTF_SizeText in the docs:int x,y;TTF_SizeText(font_name,"text blah",&x,&y);;  Also, TTF_RenderText_Foo(...) returns a SDL_Surface.  You can access that surface's width and height with it's members 'w' and 'h':SDL_Surface *p = TTF_RenderText_Solid(...);int x = (sw / 2) - (p->w / 2);int y = (sh / 2) - (p->h / 2);;  Thanks "agi_shi" & "TravisWells" for the nice examples! Finally i made it to work!   