First Add the Skeleton of the function like so, void drawlineorrect
(LPDIRECT3DDEVICE9 pDevice,int tx,int ty,int tw,int th,D3DCOLOR COLORZ)
now add the base rect
RECT.x1 = tx-tw;//width one way
RECT.y1 = ty-th;//high one way
RECT.x2 = tx+tw;//width the other way
RECT.y2 = tx+th;//high the other way
now clear it
pDevice->Clear(1,&RECT,D3DCLEAR_TARGET,COLORZ,0,0);
Result :
void drawlineorrect(LPDIRECT3DDEVICE9 pDevice,int tx,int ty,int tw,int th,D3DCOLOR COLORZ)
{
D3DRECT RECTONE;
RECTONE.x1 = tx-tw;
RECTONE.y1 = ty-th;
RECTONE.x2 = tx+tw;
RECTONE.y2 = ty+th;
pDevice->Clear(1,&RECTONE,D3DCLEAR_TARGET,COLORZ,0,0);
}
line would be the same except the width = 1 (if you want it to be vertical line)
or the height = 1 if you want it horizontal
void drawtext(LPDIRECT3DDEVICE9 pDevice,int tx,int ty,D3DCOLOR COLORZ,font,char textstring[])
{
D3DRECT TEXTREC;
TEXTREC.x1 = x;
TEXTREC.y1 = y;
TEXTREC.x2 = x+999;
TEXTREC.y2 = y+400;
font->DrawText(NULL,textstring,-1,&TEXTREC,DT_LEFT | DT_WORDBREAK,COLORZ)
}
by pyroctain666