Sign in to follow this  
Andy474

SetRect()

Recommended Posts

Hi Again. A Question that I cant get answered on MSDN. (well I can but I don't understand)
bool cText::Print(LPD3DXFONT ppFont, LPCSTR Text, long xLeft, long yLeft, long xRight, long yRight, TEXTCOLOR TextColor)
{
	/**static RECT textbox; SetRect(&textbox, xLeft, yLeft, xRight, yRight); 

	ppFont->DrawTextA(NULL, Text, -1, &textbox,
		DT_CENTER | DT_VCENTER, TextColor);
	return true;
}

with the rectangle,'textbox' am I right in thinking you specify the co-ordinates of the top left, and bottom right corners of the rect? if yes, I am Setting the rectangle with the function
Font.Print(helptext,"My Help Text \n Keys: \n -> ESC - Closes Window", 0,443,213,590, TEXT_WHITE);
How come this doesn't show in my Window (Width = 640, Height = 590;)? p.s If there is an easier way to create rectangles, other ways of setting Text are welcome ;)

Share this post


Link to post
Share on other sites
Your not checking for errors by the looks of things, ppFont may not be a valid pointer*2 to a font object.

Could also be that your not setting the alpha to anyhing when you draw your text, i often have problems like that, and have now learnt that whenever something isnt drawing check the alpha setting.. Im not sure if its the same for you though, nothing seems to be wrong with the rest, so if your still having problems, may be somewhere else in the code, size of the text by any chance.

also, if you havent adjusted your window so that tehe client area becomes the designated width and height youve set, that could also be causing problems when you position stuff. (small chance but is possible).

Sorry i couldnt help anymore than that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this