Page 1 of 1
Digital Clock
Posted: Thu Nov 09, 2006 2:58 am
by Guimauve
Hello everyone.
This is a full screen digital clock. The default setting are in french but see in the InitDigitalClock() and uncomment the english setting then comment the french setting to see the date in english.
As always the programming technics is Based Object Porgramming (BOP)
Have fun
Regards
Guimauve
File:1->
DigitalClock.zip

Posted: Thu Nov 09, 2006 6:38 pm
by Flype
nice, that is a pretty and instructive code.
thank you guimauve.
you forget to remove your custom RGBColor() macro or function in one of the includes. i just changed it to RGB() and it's OK.
Posted: Thu Nov 09, 2006 7:46 pm
by Guimauve
This is the correction. Just copy replace this procedure or edit directly.
Code: Select all
Procedure DrawStarField(*StarFieldA.StarField)
StartDrawing(ScreenOutput()) ;>
DrawingMode(1)
For Index = 0 To #STARFIELD_STAR_MAX - 1
GetStarFieldPosZ(*StarFieldA, Index) - GetStarFieldSpeed(*StarFieldA, Index)
SX = GetStarFieldPosX(*StarFieldA, Index) / GetStarFieldPosZ(*StarFieldA, Index) * 100 + GetStarFieldScreenWidth(*StarFieldA) / 2
SY = GetStarFieldPosY(*StarFieldA, Index) / GetStarFieldPosZ(*StarFieldA, Index) * 100 + GetStarFieldScreenHeight(*StarFieldA) / 2
If SX < 0 Or SY < 0 Or SX >= GetStarFieldScreenWidth(*StarFieldA) Or SY >= GetStarFieldScreenHeight(*StarFieldA) Or GetStarFieldPosZ(*StarFieldA, Index) < 1
RefreshStar3D(*StarFieldA, Index)
Else
Couleur = Int(255 - GetStarFieldPosZ(*StarFieldA, Index) * (255/1000))
Plot(SX, SY, RGB(Couleur,Couleur,Couleur)) ; Here change RGBColor() with RGB()
EndIf
Next
StopDrawing() ;<
EndProcedure
Thanks Flype
Regards
Guimauve