Thread: Analog Clock

Results 1 to 9 of 9
  1. #1
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514

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

  2. The Following User Says Thank You to GameTrainerMaker For This Useful Post:

    hgmf8124 (08-22-2010)

  3. #2
    mastermods's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    108
    Reputation
    9
    Thanks
    42
    My Mood
    Chatty
    great job gtm!

  4. #3
    swatfx's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    659
    Reputation
    20
    Thanks
    108
    My Mood
    Mellow
    sounds sexy.. do u have a screenshot?

  5. #4
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514
    no Sorry!! i formatted and dont have any games,programs etc

  6. #5
    nhannie's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    australia
    Posts
    21
    Reputation
    10
    Thanks
    0
    hi hows it going?

  7. #6
    IcySeal's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    300
    Reputation
    34
    Thanks
    148
    My Mood
    Amused
    You're missing a bunch of things in this...

  8. #7
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514
    i no. if the leechers are good C++ers then they will no how to fix it!

  9. #8
    IcySeal's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    300
    Reputation
    34
    Thanks
    148
    My Mood
    Amused
    Angle to radian function, Surface, and the DrawLine function.

    Those aren't hard though.

  10. #9
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,689
    Reputation
    184
    Thanks
    1,149
    My Mood
    Aggressive
    Nothing Google cant fix.. /me

Similar Threads

  1. [Tut?]Make analog clock
    By /b/oss in forum Visual Basic Programming
    Replies: 5
    Last Post: 05-09-2010, 01:39 AM
  2. Analog Clock
    By Zoom in forum Visual Basic Programming
    Replies: 1
    Last Post: 10-15-2009, 11:59 AM
  3. [Tutorial]VB2008! How To Make Digital Clock On Your Form!
    By almog6666 in forum Visual Basic Programming
    Replies: 3
    Last Post: 04-09-2009, 01:55 PM
  4. Clock Suckers - Funny or Lame?
    By daowner2 in forum General
    Replies: 8
    Last Post: 04-29-2008, 12:20 PM
  5. 3 o' clock in the morning
    By Doupleganger in forum Spammers Corner
    Replies: 8
    Last Post: 07-21-2007, 08:24 AM