Affichage des articles dont le libellé est rect. Afficher tous les articles
Affichage des articles dont le libellé est rect. Afficher tous les articles

mercredi 29 janvier 2014

[Discuss] Using RECT for text topic




I'm using RECT structure for text and it isn't working out. The text is all over the place. I've tried everything... I'm stuck...


Code:


if( ProjectScreen( pEnt->LerpOrigin, &x, &y ) )
{
                //(x-w/2,y-h/2,w,h);
                // Top Left
                FontPosition2.left = ( x - refdef->Width ) / 2;
                FontPosition2.top = ( y - refdef->Height ) / 2;

                // Lower Right
                FontPosition2.right = refdef->Width;
                FontPosition2.bottom = refdef->Height;


g_Font->DrawText( NULL, client->ClientName, -1, &FontPosition2, DT_CENTER, Team ); //draw text

}




How do I get this RECT to center the text and then plot it on the players coord ( x, y )...


This is killing me....


This works fine for lines...
ProjectScreen( pEnt->LerpOrigin, &enemyX, &enemyY );
DrawLine( refdef->Width / 2, refdef->Height, enemyX, enemyY, 1.0f )



Basically I want to put the players name at the end of the line or vector.

Anyone know how to do that?


...