Help again please /tehe

Posts 1–9 of 9 · Page 1 of 1
Help again please /tehe
Sorry guy's can i use your help again please..
I could'nt bump the 1 week old thread about drawing shap's so i made a new 1 ..
Anyway how would i draw a line sideway's like this,

ty /
in D3D? you could do it with DrawPrimitive (link here)

And then it depens on what you prefer a
D3DPT_LINELIST or a D3DPT_LINESTRIP
Using "DrawLine"
And stuff...
Quote Originally Posted by wassup40 View Post
Using "DrawLine"
And stuff...
I've never seen it before, just make your DrawBox/Background/etc, a sprite /
Would be quite easy making such a function might be good to add to my cDraw
iopop9 thinks he is sooo smart
Use this function:
Code:
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
    D3DXVECTOR2 vLine[2];
    pLine->SetWidth( width );
    pLine->SetAntialias( false );
    pLine->SetGLLines( true );
    vLine[0].x = x;
    vLine[0].y = y;
    vLine[1].x = x2;
    vLine[1].y = y2;
    pLine->Begin();
    pLine->Draw( vLine, 2, color );
    pLine->End();
}
To Draw it:
Code:
DrawLine(StartposX,StartposY,EndposX,EndposY,Thickness,Color);
Change the words in orange to what ever coordinates u want.

Im not sure why ur doing this but if its for a X hair use this.
Code:
DrawLine(ScreenCenterX+10,ScreenCenterY+10,ScreenCenterX-10,ScreenCenterY-10,1,Red);
DrawLine(ScreenCenterX-10,ScreenCenterY+10,ScreenCenterX+10,ScreenCenterY-10,1,Red);
This is how i do it, maybe there is an easier way but yeah.
Enjoy (:
Quote Originally Posted by Rusty3 View Post
Use this function:
Code:
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
    D3DXVECTOR2 vLine[2];
    pLine->SetWidth( width );
    pLine->SetAntialias( false );
    pLine->SetGLLines( true );
    vLine[0].x = x;
    vLine[0].y = y;
    vLine[1].x = x2;
    vLine[1].y = y2;
    pLine->Begin();
    pLine->Draw( vLine, 2, color );
    pLine->End();
}
To Draw it:
Code:
DrawLine(StartposX,StartposY,EndposX,EndposY,Thickness,Color);
Change the words in orange to what ever coordinates u want.

Im not sure why ur doing this but if its for a X hair use this.
Code:
DrawLine(ScreenCenterX+10,ScreenCenterY+10,ScreenCenterX-10,ScreenCenterY-10,1,Red);
DrawLine(ScreenCenterX-10,ScreenCenterY+10,ScreenCenterX+10,ScreenCenterY-10,1,Red);
This is how i do it, maybe there is an easier way but yeah.
Enjoy (:
Thank's man worked
Quote Originally Posted by Rusty3 View Post
Use this function:
Code:
void DrawLine(float x, float y, float x2, float y2, float width, DWORD color)
{
    D3DXVECTOR2 vLine[2];
    pLine->SetWidth( width );
    pLine->SetAntialias( false );
    pLine->SetGLLines( true );
    vLine[0].x = x;
    vLine[0].y = y;
    vLine[1].x = x2;
    vLine[1].y = y2;
    pLine->Begin();
    pLine->Draw( vLine, 2, color );
    pLine->End();
}
To Draw it:
Code:
DrawLine(StartposX,StartposY,EndposX,EndposY,Thickness,Color);
Change the words in orange to what ever coordinates u want.

Im not sure why ur doing this but if its for a X hair use this.
Code:
DrawLine(ScreenCenterX+10,ScreenCenterY+10,ScreenCenterX-10,ScreenCenterY-10,1,Red);
DrawLine(ScreenCenterX-10,ScreenCenterY+10,ScreenCenterX+10,ScreenCenterY-10,1,Red);
This is how i do it, maybe there is an easier way but yeah.
Enjoy (:
Thanks, I thought that using a sprite was the only way

*Gimme my 500 (Expert Member)
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us