Jump to content
  • Advertisement
Sign in to follow this  
Andy474

SetRect()

This topic is 3413 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!