OldSchoolHack

Register / Login English

Text Zentrieren (D3D)

icon Thread: Text Zentrieren (D3D)

Join Date: Aug 2007

Posts: 8643

User-Rating:

199 positive
33 negative
kann man auch einfacher haben

CPP Code:
  1. int Functions::GetCharLen(LPD3DXFONT Font, LPCTSTR szString)
  2. {
  3. RECT rect = {0,0,0,0};
  4. Font->DrawText(NULL, szString, -1, &rect, DT_CALCRECT, 0);
  5.  
  6. return rect.right;
  7. }
  8.  
  9. oshicod.pFunctions->DrawString(oshicod.pFunctions->SteamFont,300-(oshicod.pFunctions->GetCharLen(oshicod.pFunctions->SteamFont,"maybe someone can use this")/2),15,oshicod.pGui->STEAM_GELB,"maybe someone can use this");


__________________

Hallo