Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualLeftyGuitar

Posted 18 September 2013 - 02:44 PM

Thanks for the help. The stylisitic code will help make the code look more organized. Also what I'm trying to do is display and get the coords of the mouse's x and y values. mx and my are set to zero. I want the position of x and y to contiunally update. The object is to shoo the balls with the mouse.

 

EDIT: I also forgot to note that I am trying to show the value of mx and my using stringstreams.

stringstream sMouse[2];

sMouse[0] << mx;
	sMouse[1] << my;

	MouseText[0] = TTF_RenderText_Solid(Font,"MouseX:",textColor);
	MouseTextRect[0].x = 1;
	MouseTextRect[0].y = 1;
	MouseTextRect[0].w = 0;
	MouseTextRect[0].h = 0;
	MouseText[1] = TTF_RenderText_Solid(Font,"MouseY:",textColor);
	MouseTextRect[1].x = 1;
	MouseTextRect[1].y = 20;
	MouseTextRect[1].w = 0;
	MouseTextRect[1].h = 0;
	MouseText[2] = TTF_RenderText_Solid(Font,sMouse[0].str().c_str(),textColor);
	MouseTextRect[2].x = 80;
	MouseTextRect[2].y = 1;
	MouseTextRect[2].w = 0;
	MouseTextRect[2].h = 0;
	MouseText[3] = TTF_RenderText_Solid(Font,sMouse[1].str().c_str(),textColor);
	MouseTextRect[3].x = 80;
	MouseTextRect[3].y = 20;
	MouseTextRect[3].w = 0;
	MouseTextRect[3].h = 0;

Not sure, but perhaps I am doing something wrong with this code?


#1LeftyGuitar

Posted 17 September 2013 - 12:18 PM

Thanks for the help. The stylisitic code will help make the code look more organized. Also what I'm trying to do is display and get the coords of the mouse's x and y values. mx and my are set to zero. I want the position of x and y to contiunally update. The object is to shoo the balls with the mouse.


PARTNERS