Page 1 of 1
spinblur clock
Posted: Wed Nov 01, 2023 7:15 pm
by firace
Just a little idea for a cool clock - I'm sure it can be made much better!
Notes:
- Tested under Win10, Win 11 and Ubuntu
- (optional) try setting the Library Subsystem in Compiler options to
DirectX9
Code: Select all
InitSprite() :
W=760 : H=540 : C = $324F72 : Cellsize = 50 : LoadFont(99, "Consolas", 32)
OpenWindow(0, 35, 35, W+1, H, "firace's spinblur clock", #PB_Window_SizeGadget|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,W+1,H,1,0,0) : AddWindowTimer(0, 1, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Timer :
ClearScreen(0)
FlipBuffers()
CreateSprite(33, W+200,W+200)
StartDrawing(SpriteOutput(33))
DrawingFont(FontID(99))
sec$ = FormatDate("%hh:%ii:%ss", Date())
DrawText(350,350,Sec$)
StopDrawing()
x = 0
Repeat : x+1
StartDrawing(ScreenOutput())
Box(-90,-140,W+200,W+200,0)
StopDrawing()
RotateSprite(33, 18,#PB_Relative) : DisplayTransparentSprite(33,-90,-140,42)
FlipBuffers()
Until x = 20
StartDrawing(ScreenOutput())
Box(-90,-140,W+200,W+200,0)
StopDrawing()
DisplayTransparentSprite(33,-90,-140,242)
FlipBuffers()
EndSelect
ForEver
Re: spinblur clock
Posted: Wed Nov 01, 2023 7:17 pm
by firace
BTW Is anyone able to get a screenshot of the spinning effect ? I can't

Re: spinblur clock
Posted: Wed Nov 01, 2023 8:04 pm
by HeX0R
That doesn't seem to work with latest PB version, I saw only a black window.
But with PB 5.73 it works just fine
Re: spinblur clock
Posted: Wed Nov 01, 2023 8:36 pm
by firace
HeX0R wrote: Wed Nov 01, 2023 8:04 pm
That doesn't seem to work with latest PB version, I saw only a black window.
But with PB 5.73 it works just fine
Damn! Not sure how to fix it.
Re: spinblur clock
Posted: Wed Nov 01, 2023 9:17 pm
by miso
That way I can see something:
Code: Select all
InitSprite() : W=750 : H=540 : C = $324F72 : Cellsize = 50 : LoadFont(99, "Consolas", 36)
OpenWindow(0, 35, 35, W+1, H, "firace's spinblur clock", #PB_Window_SizeGadget|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,W+1,H,1,0,0) : AddWindowTimer(0, 1, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Timer :
ClearScreen(0)
CreateSprite(33, W+200,W+200)
StartDrawing(SpriteOutput(33))
: DrawingFont(FontID(99))
a = 350
b = 350
sec$ = FormatDate("%hh:%ii:%ss", Date())
;DrawingMode(#PB_2DDrawing_Transparent)
DrawRotatedText(a+3,b+3,Sec$,0)
StopDrawing()
TransparentSpriteColor(33,0)
x = 0
Repeat : x+1
RotateSprite(33, 18,#PB_Relative) : DisplayTransparentSprite(33,-90,-140,42)
FlipBuffers()
Until x = 20
DisplayTransparentSprite(33,-90,-140,242)
FlipBuffers()
EndSelect
ForEver
Re: spinblur clock
Posted: Wed Nov 01, 2023 9:51 pm
by Paul
HeX0R wrote: Wed Nov 01, 2023 8:04 pm
That doesn't seem to work with latest PB version, I saw only a black window.
But with PB 5.73 it works just fine
Works here if I change Library Subsystem to DirectX9
Re: spinblur clock
Posted: Wed Nov 01, 2023 10:02 pm
by firace
Paul wrote: Wed Nov 01, 2023 9:51 pm
HeX0R wrote: Wed Nov 01, 2023 8:04 pm
That doesn't seem to work with latest PB version, I saw only a black window.
But with PB 5.73 it works just fine
Works here if I change Library Subsystem to DirectX9
Confirmed! Thanks for testing
Re: spinblur clock
Posted: Wed Nov 01, 2023 11:03 pm
by Kiffi
firace wrote: Wed Nov 01, 2023 7:17 pm
BTW Is anyone able to get a screenshot of the spinning effect ? I can't
At your service
Re: spinblur clock
Posted: Wed Nov 01, 2023 11:52 pm
by firace
Kiffi wrote: Wed Nov 01, 2023 11:03 pm
firace wrote: Wed Nov 01, 2023 7:17 pm
BTW Is anyone able to get a screenshot of the spinning effect ? I can't
At your service
Thanks!
Re: spinblur clock
Posted: Thu Nov 02, 2023 8:52 am
by firace
Made a few tweaks to have it work under Linux
Re: spinblur clock
Posted: Thu Nov 02, 2023 9:12 am
by BarryG
@Miso, Your version doesn't fade the numbers, so they all just become a blurred circle:

Re: spinblur clock
Posted: Thu Nov 02, 2023 11:13 am
by miso
@BarryG
Yes, I did not know what should I see. With the base OpenGL the first version was pitch black, with the change a saw something. Looks like the OpenGL behaves much different...
With extra ClearScreen()s, thats the closest I can get, but this should work with OpenGL subsystem.
Edit: looks like the first version has also been updated, to be OK with OpenGL.
Code: Select all
InitSprite() : W=750 : H=540 : C = $324F72 : Cellsize = 50 : LoadFont(99, "Consolas", 36)
OpenWindow(0, 35, 35, W+1, H, "firace's spinblur clock", #PB_Window_SizeGadget|#PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(0),0,0,W+1,H,1,0,0) : AddWindowTimer(0, 1, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow : Break
Case #PB_Event_Timer :
ClearScreen(0)
;If IsSprite(33) : FreeSprite(33) :EndIf
CreateSprite(33, W+200,W+200)
StartDrawing(SpriteOutput(33))
: DrawingFont(FontID(99))
a = 350
b = 350
sec$ = FormatDate("%hh:%ii:%ss", Date())
;DrawingMode(#PB_2DDrawing_Transparent)
DrawRotatedText(a+3,b+3,Sec$,0)
StopDrawing()
TransparentSpriteColor(33,0)
x = 0
Repeat : x+1
RotateSprite(33, 18,#PB_Relative) : DisplayTransparentSprite(33,-90,-140,42)
FlipBuffers()
ClearScreen(0)
Until x = 20
DisplayTransparentSprite(33,-90,-140,242)
FlipBuffers()
EndSelect
ForEver
Re: spinblur clock
Posted: Thu Nov 02, 2023 5:11 pm
by Mijikai
Nice (works fine for me on PB x64 6.03)
Re: spinblur clock
Posted: Thu Nov 02, 2023 10:12 pm
by firace
Mijikai wrote: Thu Nov 02, 2023 5:11 pm
Nice (works fine for me on PB x64 6.03)
Thanks!
By the way I'm trying to
convert it to SpiderBasic, but there are still some hurdles to resolve, as I'm not that familiar with SpiderBasic.
In case anyone from this topic wants to try it out and "fix" it...
