Thread: Digital Clock

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514

    Digital Clock

    Code:
    void Paint_Part_horizontal(int iX, int iY, bool bActive)
    {
    	Vertex_t vertPart_waagrecht[6] = 
    	{
    		Vertex_t(Vector2D(iX,iY+2)),
    		Vertex_t(Vector2D(iX+2,iY)),
    		Vertex_t(Vector2D(iX+22,iY)),
    		Vertex_t(Vector2D(iX+24,iY+2)),
    		Vertex_t(Vector2D(iX+22,iY+4)),
    		Vertex_t(Vector2D(iX+2,iY+4))
    	};
    	DWORD dwColor = bActive ? 0xFF0000FF : 0x323232FF;
    
    	g_pDraw->drawFilledPolygon(6,vertPart_waagrecht,dwColor);
    }
    
    void cTools::Paint_Part_vertical(int iX, int iY, bool bActive)
    {
    	Vertex_t vertPart_senkrecht[6] = 
    	{
    		Vertex_t(Vector2D(iX+2,iY)),
    		Vertex_t(Vector2D(iX+4,iY+2)),
    		Vertex_t(Vector2D(iX+4,iY+22)),
    		Vertex_t(Vector2D(iX+2,iY+24)),
    		Vertex_t(Vector2D(iX,iY+22)),
    		Vertex_t(Vector2D(iX,iY+2))
    	};
    	DWORD dwColor = bActive ? 0xFF0000FF : 0x323232FF;
    
    	g_pDraw->drawFilledPolygon(6,vertPart_senkrecht,dwColor);
    }
    
    void cTools::Paint_eighth(int iX, int iY, int iZiffer)
    {
    	/*
    	  1
    	  _
       0 | | 2
    	  - 3
       6 | | 4
    	  -
    	  5
    	*/
    	bool bActive[7];
    	switch (iZiffer)
    	{
    	case 0:
    		bActive[0] = 1; bActive[1] = 1; bActive[2] = 1; bActive[3] = 0; bActive[4] = 1; bActive[5] = 1; bActive[6] = 1;
    		break;
    	case 1:
    		bActive[0] = 0; bActive[1] = 0; bActive[2] = 1; bActive[3] = 0; bActive[4] = 1; bActive[5] = 0; bActive[6] = 0;
    		break;
    	case 2:
    		bActive[0] = 0; bActive[1] = 1; bActive[2] = 1; bActive[3] = 1; bActive[4] = 0; bActive[5] = 1; bActive[6] = 1;
    		break;
    	case 3:
    		bActive[0] = 0; bActive[1] = 1; bActive[2] = 1; bActive[3] = 1; bActive[4] = 1; bActive[5] = 1; bActive[6] = 0;
    		break;
    	case 4:
    		bActive[0] = 1; bActive[1] = 0; bActive[2] = 1; bActive[3] = 1; bActive[4] = 1; bActive[5] = 0; bActive[6] = 0;
    		break;
    	case 5:
    		bActive[0] = 1; bActive[1] = 1; bActive[2] = 0; bActive[3] = 1; bActive[4] = 1; bActive[5] = 1; bActive[6] = 0;
    		break;
    	case 6:
    		bActive[0] = 1; bActive[1] = 1; bActive[2] = 0; bActive[3] = 1; bActive[4] = 1; bActive[5] = 1; bActive[6] = 1;
    		break;
    	case 7:
    		bActive[0] = 0; bActive[1] = 1; bActive[2] = 1; bActive[3] = 0; bActive[4] = 1; bActive[5] = 0; bActive[6] = 0;
    		break;
    	case 8:
    		bActive[0] = 1; bActive[1] = 1; bActive[2] = 1; bActive[3] = 1; bActive[4] = 1; bActive[5] = 1; bActive[6] = 1;
    		break;
    	case 9:
    		bActive[0] = 1; bActive[1] = 1; bActive[2] = 1; bActive[3] = 1; bActive[4] = 1; bActive[5] = 1; bActive[6] = 0;
    		break;
    	default:
    		bActive[0] = 0; bActive[1] = 0; bActive[2] = 0; bActive[3] = 0; bActive[4] = 0; bActive[5] = 0; bActive[6] = 0;
    		break;
    	}
    
    	Paint_Part_vertical(iX,iY+2,bActive[0]); // 0
    	Paint_Part_horizontal(iX+2,iY,bActive[1]); // 1
    	Paint_Part_vertical(iX+24,iY+2,bActive[2]); // 2
    	Paint_Part_horizontal(iX+2,iY+24,bActive[3]); // 3
    	Paint_Part_vertical(iX+24,iY+26,bActive[4]); // 4
    	Paint_Part_horizontal(iX+2,iY+48,bActive[5]); // 5
    	Paint_Part_vertical(iX,iY+26,bActive[6]); // 6
    }
    
    void cTools::PaintClockDigital(int iX, int iY)
    {
    	if (!m_pEngine->IsInGame())
    		return;
    
    	/*
    	Hauptkasten
    	*/
    	g_pDraw->fillRGBA(iX-1, iY-1, 202, 62, 0x323232FF); // grauer Rand
    	g_pDraw->fillRGBA(iX, iY, 200, 60, 0x000000FF); // schwarze Hauptfläche
    
    	/*
    	Ränder für die Zahlengruppen
    	*/
    	g_pDraw->drawBorder(iX+2, iY+2, 60, 56, 1, 0x323232FF); // links
    	g_pDraw->drawBorder(iX+70, iY+2, 60, 56, 1, 0x323232FF); // mitte
    	g_pDraw->drawBorder(iX+138, iY+2, 60, 56, 1, 0x323232FF); // rechts
    
    	/*
    	Punkte dazwischen
    	*/
    	g_pDraw->drawFilledCircle(iX+66, iY+18, 2, 0x323232FF); // links oben
    	g_pDraw->drawFilledCircle(iX+66, iY+42, 2, 0x323232FF); // links unten
    	g_pDraw->drawFilledCircle(iX+134, iY+18, 2, 0x323232FF); // rechts oben
    	g_pDraw->drawFilledCircle(iX+134, iY+42, 2, 0x323232FF); // rechts unten
    
    	/*
    	Zeit holen
    	*/
    	tm *current_tm;
    	time_t current_time;
    
    	time(&current_time);
    	current_tm = localtime(&current_time);
    
    	/*
    	Stunden
    	*/
    	int iHour_tenner_numeral = current_tm->tm_hour / 10;
    	int iHour_one_numeral = current_tm->tm_hour % 10;
    
    	Paint_eighth(iX+3, iY+4, iHour_tenner_numeral);
    	Paint_eighth(iX+33, iY+4, iHour_one_numeral);
    
    	/*
    	Minuten
    	*/
    	int iMin_tenner_numeral = current_tm->tm_min / 10;
    	int iMin_one_numeral = current_tm->tm_min % 10;
    
    	Paint_eighth(iX+71, iY+4, iMin_tenner_numeral);
    	Paint_eighth(iX+101, iY+4, iMin_one_numeral);
    
    	/*
    	Sekunden
    	*/
    	int iSec_tenner_numeral = current_tm->tm_sec / 10;
    	int iSec_one_numeral = current_tm->tm_sec % 10;
    
    	Paint_eighth(iX+139, iY+4, iSec_tenner_numeral);
    	Paint_eighth(iX+169, iY+4, iSec_one_numeral);
    }
    CREDITS NOT TO ME

    Last edited by GameTrainerMaker; 08-22-2010 at 04:48 PM.

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

    whit (08-22-2010)

  3. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,170
    Reputation
    490
    Thanks
    2,252
    Umm You Really Like Clocks../

  4. #3
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514
    Lol!! yea i hate playing any game, then not relising the time..

  5. #4
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,170
    Reputation
    490
    Thanks
    2,252
    thks for the ss..

  6. #5
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514
    No Probs
    -to short-

  7. #6
    J's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    East Coast
    Posts
    2,159
    Reputation
    379
    Thanks
    5,762
    My Mood
    In Love
    Leeched is leeched.
    Keep me motivated for my hack development!

  8. #7
    deathninjak0's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    1,512
    Reputation
    12
    Thanks
    294
    My Mood
    Cool
    Give credits :P

  9. #8
    GameTrainerMaker's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    465
    Reputation
    17
    Thanks
    514
    Death go away noob.

    Blood sorry!! i forgot to add the credits

  10. #9
    Dreamer's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Seattle
    Posts
    8,755
    Reputation
    333
    Thanks
    1,451
    My Mood
    Breezy
    aha nice. But its easier to use xfire's time :P
    Resource Team: Feb/5/2012 - May/5/2012
    Middleman: April/25/2012 - September/16/12


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

  12. #11
    ac1d_buRn's Avatar
    Join Date
    Aug 2009
    Gender
    female
    Location
    CA Source Section
    Posts
    3,406
    Reputation
    157
    Thanks
    3,993
    My Mood
    Flirty
    Nice clock. Beats my shitty one D:

  13. #12
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,690
    Reputation
    184
    Thanks
    1,147
    My Mood
    Aggressive
    To fucking big XD

  14. #13
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Doesnt have all required functions but cool.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  15. #14
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,690
    Reputation
    184
    Thanks
    1,147
    My Mood
    Aggressive
    Quote Originally Posted by whatup777 View Post
    Doesnt have all required functions but cool.
    FUCKING GOOGLE.COM

  16. #15
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,030
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    I know Im just letting people know.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 05-29-2010, 01:07 AM
  2. [Tutorial]VB2008! How To Make Digital Clock On Your Form!
    By almog6666 in forum Visual Basic Programming
    Replies: 3
    Last Post: 04-09-2009, 02:55 PM
  3. Digital Coders Public Hack
    By Luigid in forum WarRock - International Hacks
    Replies: 4
    Last Post: 06-08-2007, 02:08 AM
  4. Electronic Digital
    By Dave84311 in forum General
    Replies: 5
    Last Post: 06-06-2006, 02:07 PM