Results 1 to 1 of 1
  1. #1
    Dwar is offline
    Veteran Dwar's Avatar
    Join Date
    2010 Mar
    Thanked 2,224 Times in 289 Posts
    Rep Power

    Drawing Rects/Lines/Text

    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

    Result :
    void drawlineorrect(LPDIRECT3DDEVICE9 pDevice,int tx,int ty,int tw,int th,D3DCOLOR COLORZ)
    RECTONE.x1 = tx-tw;
    RECTONE.y1 = ty-th;
    RECTONE.x2 = tx+tw;
    RECTONE.y2 = ty+th;

    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[])
    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
    Please, post your questions on forum, not by PM or mail

    I spend my time, so please pay a little bit of your time to keep world in equilibrium

Visitors found this page by searching for:

d3d drawrect

drawbox D3D

D3D Text

c d3d text

D3D Draw Box

D3D Line

c d3d draw line

d3d draw rect

C d3d line

d3d draw Rectangle

d3d10 draw line

d3dx draw line

d3dx draw rectangle

draw Box D3Ddrawline d3dd3d10 draw linesc draw d3d linedrawbox c d3dd3d drawboxLPDIRECT3DDEVICE9 draw textdraw box in d3dDrawlineorrectc d3d boxdrawrect d3ddirect3d line draw

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts