DigitalClock Animation

Share your advanced PureBasic knowledge/code with the community.
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

DigitalClock Animation

Post by StarBootics »

Hello everyone,

A DigitalClock screen animation that can be use as a screen saver if you wish. The source code is too big to be posted directly, so this is the download link.
https://www.dropbox.com/s/snegzvvq4gemt ... k.zip?dl=0
https://www.dropbox.com/s/bn0p3nwgg5urs ... t.png?dl=0

Best regards
StarBootics
Last edited by StarBootics on Fri Sep 09, 2016 6:33 pm, edited 1 time in total.
The Stone Age did not end due to a shortage of stones !
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: DigitalClock Animation

Post by netmaestro »

Looks very nice! Great presentation, nice graphics 8)
BERESHEIT
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: DigitalClock Animation

Post by StarBootics »

Hello everyone

I forget to change the date mask to "English" style. Just change this line :

Code: Select all

Date::Initialize(CenterX + LED_Size, CenterY + Y_reduce + 200, 6, "%mm-%dd-%yyyy")
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: DigitalClock Animation

Post by davido »

Very nice.
Thank you for sharing.
DE AA EB
Joris
Addict
Addict
Posts: 890
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: DigitalClock Animation

Post by Joris »

If I wont to download the zip I need to log in and give my personal info to dropbox.
I don't wont that, as I know it will be a start of a new spam-war.
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
infratec
Always Here
Always Here
Posts: 7618
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: DigitalClock Animation

Post by infratec »

You have to close the login window, then you can download the file.
Wolfram
Enthusiast
Enthusiast
Posts: 604
Joined: Thu May 30, 2013 4:39 pm

Re: DigitalClock Animation

Post by Wolfram »

Nice, works on OSX too
macOS Catalina 10.15.7
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: DigitalClock Animation

Post by Kwai chang caine »

Splendid !!! i have tyhe space vertigo with this clock :D
Works very well, except just, i don't know if it's normal but the last number is under the right points of colors
Else very nice effect, thanks for sharing 8)
ImageThe happiness is a road...
Not a destination
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: DigitalClock Animation

Post by StarBootics »

Kwai chang caine wrote:Splendid !!! i have tyhe space vertigo with this clock :D
Works very well, except just, i don't know if it's normal but the last number is under the right points of colors
Else very nice effect, thanks for sharing 8)
Can you run this code and post back the Debugger output ?

Code: Select all

ExamineDesktops()
Width = DesktopWidth(0)
Height = DesktopHeight(0)
Depth = DesktopDepth(0)

Debug Width
Debug Height
Debug Depth
Best regards
StarBootics
Last edited by StarBootics on Fri Sep 09, 2016 11:07 am, edited 1 time in total.
The Stone Age did not end due to a shortage of stones !
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: DigitalClock Animation

Post by wilbert »

It looks nice but unfortunately doesn't work on the OSX x64 version.
It has to do with values being types as .l instead of .i
All ...SpriteID variables need to be .i
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: DigitalClock Animation

Post by StarBootics »

wilbert wrote:It looks nice but unfortunately doesn't work on the OSX x64 version.
It has to do with values being types as .l instead of .i
All ...SpriteID variables need to be .i
Corrected, the new source should work out of the box on OSX x64.

I'm currently reworking the FullScreen Module to select the biggest Screen resolution supported so stay tuned.

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: DigitalClock Animation

Post by Keya »

i just get "Can't open screen !" error message from Main.pb, on both WinXP-32 and Win7-64 and OSX El Capitan 64. PB 5.42LTS
any chance of a screenshot please?!?
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: DigitalClock Animation

Post by StarBootics »

Keya wrote:i just get "Can't open screen !" error message from Main.pb, on both WinXP-32 and Win7-64 and OSX El Capitan 64. PB 5.42LTS
any chance of a screenshot please?!?
https://www.dropbox.com/s/bn0p3nwgg5urs ... t.png?dl=0
You should have something like this.

Edit : I reuploaded the source with the reworked FullScreen Module

Best regards
Starbootics
The Stone Age did not end due to a shortage of stones !
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: DigitalClock Animation

Post by Keya »

it works in OSX now but still the same error in WinXP and Win7
very beautiful and i love the starfield! :)
[edit] and WOW im amazed by how little code there is to move the starfield!! super cool (always wondered how these were done)

Code: Select all

    If StartDrawing(ScreenOutput())     
      For Star3DID = 0 To #STAR3D_MAX - 1       
        Instance\Star3D[Star3DID]\Pz = Instance\Star3D[Star3DID]\Pz - Instance\Star3D[Star3DID]\Speed 
        SX = Instance\Star3D[Star3DID]\Px / Instance\Star3D[Star3DID]\Pz * 100 + Instance\ScreenW / 2
        SY = Instance\Star3D[Star3DID]\Py / Instance\Star3D[Star3DID]\Pz * 100 + Instance\ScreenH / 2
        If SX <= 0 Or SY <= 0 Or SX >= Instance\ScreenW Or SY >= Instance\ScreenH Or Instance\Star3D[Star3DID]\Pz < 1           
          RefreshStar3D(Instance\Star3D[Star3DID], Instance\SpeedMin)        
        Else           
          Couleur = Int(255 - Instance\Star3D[Star3DID]\Pz * (255/1000)) ;<- i see this is unfading the stars in, nice touch:)
          Plot(SX, SY, RGB(Couleur,Couleur,Couleur))           
        EndIf        
      Next       
      StopDrawing()      
    EndIf
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: DigitalClock Animation

Post by StarBootics »

Keya wrote:it works in OSX now but still the same error in WinXP and Win7
very beautiful and i love the starfield! :)
[edit] and WOW im amazed by how little code there is to move the starfield!! super cool (always wondered how these were done)
You should thanks benny for that code.

By the way did you try my version of Snakes of balls demo on WinXP and Win 7 ?

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Post Reply