Analog Clock

Posts 19 of 9 · Page 1 of 1
Analog Clock
Code:
void Gadget::PaintClock(int x, int y)
{
	struct tm * current_tm;
	time_t current_time;

	time (&current_time);
	current_tm = localtime (&current_time);

	//for(int r = 0; r < 50; r++)
	//{
	//	Surface->DrawColoredCircle(x,y,r,0,0,0,255);
	//}

	Surface->DrawColoredCircle(x,y,50,255,255,255,255);
	Surface->DrawColoredCircle(x,y,49,255,255,255,255);


	float alpha = 30*current_tm->tm_hour;
	float beta = 6*current_tm->tm_min;
	float phi = 6*current_tm->tm_sec;

	int nx = x+35*sin(ToRadia(alpha));
	int ny = y-35*cos(ToRadia(alpha));

	int nx2 = x+45*sin(ToRadia(beta));
	int ny2 = y-45*cos(ToRadia(beta));

	int nx3 = x+40*sin(ToRadia(phi));
	int ny3 = y-40*cos(ToRadia(phi));


	DrawLine(x,y,nx,ny);
	DrawLine(x+1,y+1,nx,ny);
	DrawLine(x,y,nx2,ny2);
	DrawLine(x+1,y+1,nx2,ny2);
	DrawLine(x,y,nx3,ny3);

}
CREDITS TO WHOEVER MADE THIS!!
great job gtm!
sounds sexy.. do u have a screenshot?
no Sorry!! i formatted and dont have any games,programs etc
hi hows it going?
You're missing a bunch of things in this...
i no. if the leechers are good C++ers then they will no how to fix it!
Angle to radian function, Surface, and the DrawLine function.

Those aren't hard though.
Nothing Google cant fix.. /me
Posts 19 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?