Results 1 to 5 of 5
  1. #1
    oyasuna.dev's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United States.
    Posts
    32
    Reputation
    10
    Thanks
    374

    Different Methods of drawing text

    First method (best in my opinion) -
    Code:
    void PrintText1(double x, double y, DWORD dwColor, LPD3DXFONT pFont, char *Text, ...)
    {
    	char buffer[256];
    
    	//This is for handling the "..." parameters
        va_list argList;
        va_start(argList, Text);
        vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer) - strlen(buffer), Text, argList);
        va_end(argList);
    
    	//Our Rect to where the text will be printed
        RECT Rect =
    	{
    		x,
    		y,
    		x + 500,
    		y + 50
    	};
    
        pFont->DrawText(NULL, buffer, -1, &Rect, DT_NOCLIP, dwColor);
    }
    Second method -
    Code:
    void PrintText2(char *Text, double x, double y, DWORD dwColor, LPD3DXFONT pFont)
    {
    	RECT FontR =
    	{
    		x,
    		y,
    		x + 500,
    		y + 30
    	};
    	pFont->DrawText(NULL, Text, -1, &FontR, DT_LEFT | DT_WORDBREAK, dwColor);
    }
    It's really just the same thing except without the extra arguments.


    CREDITS TO ME FOR BOTH FUNCTIONS!

  2. #2
    viHackz's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    78
    Thanks for this

  3. #3
    amaria5's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Thanks for this



  4. #4
    ~Syphox's Avatar
    Join Date
    May 2012
    Gender
    male
    Location
    The Third Reich
    Posts
    1,307
    Reputation
    337
    Thanks
    344
    My Mood
    Angelic
    Thank you for making this :3

  5. #5
    WhiteHat PH's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    Some Where I Belong
    Posts
    1,350
    Reputation
    25
    Thanks
    3,100
    My Mood
    Aggressive
    what is the fuction of this???






    When Im gone dont forget me cause I will come back someday.



    Youtube Channel