1. Pinoy Hideout is the Ultimate Pinoy Chat, Mobile and PC Community
    We have been leading the scene for over 7 years and currently offer:
    • latest and updated game cheats and softwares
    • internet tricks for your android phone, mobile network, and computer
    • a staff team who helps protect its members from malware while enforcing a great community

    • You must register an account before you can post, download files, and see any advanced features or content.

  2. How to avail PHO VIP hack/s?
    Click here for more Info!
    [PHO] VIP Hacks Price

      SF1 VIP|ROS VIP

    • 7 Days = php 150
    • 15 Days = php 200
    • 1 Month = php 300

      SF2 VIP

    • 7 Days = php 200
    • 15 Days = php 250
    • 1 Month = php 500
    Dismiss Notice
Dismiss Notice
Announcement!
Gusto mo bang makakuha ng VIP subcription ng libre? CLICK HERE<

DPrint Source Code

Discussion in 'D3D Tutorials and Source' started by Jhunz1337, Oct 6, 2014.

Thread Status:
Not open for further replies.
  1. Jhunz1337

    Jhunz1337 Excommunicado
    Banned! Established Member

    Reputations:
    25
    Joined:
    Jul 4, 2014
    Posts:
    201
    Likes Received:
    6
    Trophy Points:
    0

    [​IMG]
    Print
    DPrint Source Code v.1.0


    Created By: why06


    My hope is for this Project to be open source. So I've included the code below. This way people can contribute code as well as take away code for their own use.
    Code:
    //********************************************************************************
        //funtion:    DPrint()
        //purpose:    Contructs new Dprint object
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //startx:    The beginning x screen coordinate for Println
        //starty:    The beginning y screen coordinate for Println
        //vertical_spacing:    The vertical spacing between each subsequent line using Println
        //pdevice:    The D3D Device
        //********************************************************************************
        DPrint(int startx, int starty, int vertical_spacing, LPDIRECT3DDEVICE9 pdevice);
        /*Creates with autoFilter Settings*/
        //autoFilter:    Turn auto filter on or off
        //filterTime:    the frequency of auto filtration
        DPrint(int startx, int starty, int vertical_spacing, LPDIRECT3DDEVICE9 pdevice, bool autoFilter, UINT filterTime=10000);
       
        //********************************************************************
        //function: TestPrint
        //purpose:    Tests boundaries of a line of text, preparing to be written.
        //returns:    An array of RECTs holding the calculated size of each character
        //            block in the text and the whole length of the text.
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //Rectarr:    An array of RECT that one must past to the function which will
        //            be filled with the location, width and height of each character printed
        //pFormat:    A reference to the Format which holds one's font preferences
        //str:        The string to test.
        //********************************************************************
        void TestPrintln(RECT* Rectarr, LPFFORMAT pFormat, char* str);
    
        //*******************************************************************************************
        //function:    CalcConcat
        //purpose:    will return the least amount of letters that must be erased for a string in order
        //            for that string to be concatenated with a new string and still fit in the pixel
        //            limitations supplied.
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //Rectarr:    An array of RECT that one must past to the function which will
        //            be filled with the location, width and height of each character printed.
        //bufout:    bufin will be concatenated to this string.
        //bufin:    The initial string to be concatenated.
        //maxpixwidth:    The concatenated string will not be longer then maxpixwidth, if it is the string
        //                will be shortened until it fits within the horizontal limitations of maxpixwidth.
        //pFormat:    Naturally different fonts take up different amounts of screen realistate, so one must
        //            specify which font is to be made to fit in maxpixwidth.
        //*******************************************************************************************
        int CalcConcat(RECT* RectArr, char* bufout, char* bufin, int maxpixwidth, LPFFORMAT pFormat);
    
        //*********************************************************************
        //funtion: Println
        //purpose: Will print a new line of text to screen
        //returns: A reactangle holding the size of the text drawn in Rectptr
        //remarks: Starts at the locations specified by startx and starty. On each call
        //           the cursor moves down vertically vspacing pixels until ResetCursor is
        //           called which resets the cursor.
        //
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //Rectarr:    An array of RECT that one must past to the function which will
        //            be filled with the location, width and height of each character printed.
        //fontColor:The color for the text to be printed.
        //pFormat:    The Format for the text to be printed
        //str:        The text to be printed.
        //*********************************************************************
        void Println(RECT* Rectptr, D3DCOLOR fontColor, LPFFORMAT pFormat, char* str);
    
        //*********************************************************************
        //funtion: Print
        //purpose: Will print text to the size of the RECT provided
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //rbox:        A reference to a RECT. Holds coordinates for text to be printed
        //fontColor:The color for the text to be printed.
        //pFormat:    The Format for the text to be printed.
        //str:        The text to be printed.
        //*********************************************************************
        void Print(RECT* rbox, D3DCOLOR fontColor, LPFFORMAT pFormat, char* str);
       
        //*******************************************************
        // function: DrawBox
        // purpose: Will draw a box based on dimensions and color specified.
        // NOTE: Not mine. Leeched code.
        //*******************************************************
        void DrawBox(int x, int y, int w, int h, D3DCOLOR col);
    
        //********************************************************
        // function: TextBox
        // purpose: Will try to draw text in the given RECT
        /////////////////////////////PARAMETERS///////////////////////////////////////////////
        //Rectarr:        An array of RECT that one must past to the function which will
        //                be filled with the location, width and height of each character printed.
        //FormatRect:    A reference to a RECT. Holds coordinates for text to be printed.
        //text:            Text to be printed.
        //pFormat:        The Format for the text to be printed.
        //inside:        Color of inside of textbox.
        //border:        Color of border of textbox.
        //textcol:        Color of text to be printed in box.
        // *******************************************************
        void TextBox(RECT* Rectptr, RECT* FormatRect, string text, LPFFORMAT pFormat,  D3DCOLOR inside, D3DCOLOR border, D3DCOLOR textcol);
    
    
    //Font Functions
        void Filter();                                            //manual filter
        void SetFilter(bool autoFilter, UINT cycletime = 10000);//automatic filter settings
    
    //Set Functions
        void SetCursor(int newx, int newy);    //Set X and Y coords for text printing
        void ResetCursor();                    //sets Println cursor back to starty and startx.
        void Setvspc(int vertical_spacing); //change vertical spacing.
    
    //Get Functions
        int getx();//startx
        int gety();//starty
        int getvspc();// get vertical spacing
    
    //Resets Font Pointers
        void PreReset();    //OnLostDevice
        void PostReset();    //OnResetDevice
    
    //RECT HELPERS
        static RECT* rectcpy(RECT* out, RECT* in);
        static int rectw(RECT* in);    //width
        static int recth(RECT* in);    //height
    
    //TEXT HELPERS
        // a bit misleading. Does not tick all the way through only to end of text. Does not loop.
        static int TickerText(char* strin, char* strout, unsigned int constraint, int wait, int time);
    
    Credits:
    Jhunz1337 - Share/Posting

     

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Thread Status:
Not open for further replies.

Share This Page

Pinoy Hideout