SetRect()

Started by
1 comment, last by Andy474 15 years, 1 month ago
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 ;)
Advertisement
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.
Ok, thanks i'll have play around.

This topic is closed to new replies.

Advertisement