Starting a clock collection...
Michael Vogel
The clock graphic (movement) is very interesting, and as luis said, it inspires me to think of other transition effects your engine could be used for. Also, as infratec said, it could be a multi-platform program (which would make Fred happy, I'm sure).
Thanks for sharing.
The clock graphic (movement) is very interesting, and as luis said, it inspires me to think of other transition effects your engine could be used for. Also, as infratec said, it could be a multi-platform program (which would make Fred happy, I'm sure).
Thanks for sharing.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
Hi William,
I just tried this:
It works in Linux, and it should also work on all other OSs.
Pleas try it on he MAC.
Best regards,
Bernd
I just tried this:
Code: Select all
;Image(#Drawboard)=ResizeImage(#Drawboard,GX,Size(phase))
ResizeImage(#Drawboard,GX,Size(phase))
Image(#Drawboard)=ImageID(#Drawboard)
Pleas try it on he MAC.
Best regards,
Bernd
Yes, that works. That is a solution that would work on all platforms.
(I changed my full code above [and I took out a rem in line 38] so it works correctly)
A really neat effect!
Code: Select all
ResizeImage(#Drawboard,GX,Size(phase))
Image(#Drawboard)=ImageID(#Drawboard)
DrawImage(Image(#Drawboard),0,G_M-Size(phase))
LineXY(0,G_M-Size(phase),GX,G_M-Size(phase),#BorderColor)
A really neat effect!
Last edited by WilliamL on Sat Mar 21, 2009 5:32 pm, edited 1 time in total.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
FunnyKaeru Gaman wrote:just for inspiration:
http://www.jessonyip.com/analogy/


Not a destination
WOW! ...all, go see!
I think that's above my pay-scale... (means: beyond my abilities)
KCC: srod will have to lead us to the promised land.. with these advanced techniques... (but make it multi-platform, please)
I think that's above my pay-scale... (means: beyond my abilities)
KCC: srod will have to lead us to the promised land.. with these advanced techniques... (but make it multi-platform, please)
Last edited by WilliamL on Sat Mar 21, 2009 8:12 pm, edited 1 time in total.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Disgusting@KCC
your new "Avatar" is ... disgusting.
1.3MB for an avatar is not acceptable.

French traduction = Degoutant, Repugnant, Repoussant, Ecoeurant, qu'on n'aime pas
Your are perhaps a little bit too hard no

Your red frog is "Disgusting" , my animation is perhaps too big ....that's right
Furthermore...it's not a NEW avatar, because i have it since 2/3 years ago in the french forum :roll:

Not a destination
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
ok... so I use the french translator....
I would call it "impertinent" or "outrageux", to use an Animation that is 1.3MB big as an Avatar.
Remember here are Members from South America, Far Asia or Africa,
who may happen to have no flatrate and a slow connection.
It's not polite toward those people to flood their connection with a useless Animation.
I'm disappointed none of the French colleagues told you so far.
In the German forums, the maximum size for linked avatars is as limited as for uploaded avatars.
... I don't understand why it wasn't done the same way here from the very beginning.
I would call it "impertinent" or "outrageux", to use an Animation that is 1.3MB big as an Avatar.
Remember here are Members from South America, Far Asia or Africa,
who may happen to have no flatrate and a slow connection.
It's not polite toward those people to flood their connection with a useless Animation.
I'm disappointed none of the French colleagues told you so far.
In the German forums, the maximum size for linked avatars is as limited as for uploaded avatars.
... I don't understand why it wasn't done the same way here from the very beginning.
oh... and have a nice day.
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Ok ok i had change it
It's right....since we have the ADSL...i forget that not everybody have it :roll:
For the french forum....perhaps that we are all in france....then all with the ADSL :roll:
I must to say also, that now all the web page have several mb to load.
with the publicity and gif animated
Incident closed.

It's right....since we have the ADSL...i forget that not everybody have it :roll:
For the french forum....perhaps that we are all in france....then all with the ADSL :roll:
I must to say also, that now all the web page have several mb to load.
with the publicity and gif animated

Incident closed.

Not a destination
- Michael Vogel
- Addict
- Posts: 2807
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Michael,
I collect old clocks and I have one of these "flip" clocks. I think your simulation is very realistic.
I hope you don't mind, but here are my additions:
Regards,
Eric
I collect old clocks and I have one of these "flip" clocks. I think your simulation is very realistic.
I hope you don't mind, but here are my additions:
- "Flip" sound
Added colons after hours and minutes digits (just like my real one)
Options for borderless or fullscreen window
Black window background (looks better when maximized)
Regards,
Eric
Code: Select all
; Define
#Phases=10
#Halftime=#Phases>>1
#Delay=60
#BorderColor=#Gray
Enumeration
#Never
;
#Hours=0
#Minutes
#Seconds
#OldValue
#NewValue
#Drawboard
#Plate
;
#WinID
#Numbers
;
#Now
#Undefined=-1
EndEnumeration
Global WinID
; adjust window size for added colons (ebs)
Global WX=690
;Global WX=590
Global WY=200
; adjust window size for added colons (ebs)
Global GX=240
;Global GX=190
Global GY=190
Global G_X=GX-1
Global G_Y=GY-1
Global G_M=G_Y>>1
Global OX=5
Global OY=5
Global OZ=5
Global Later=#Never
Global HourLast=#Undefined
Global MinuteLast=#Undefined
Global SecondLast=#Undefined
Global Font
Global Dim Image(#Plate)
Global Text.s
Global Dim Size(#Phases)
; EndDefine
Procedure.l Greyscale(n,x)
n=x-n
n<<6
n/x
ProcedureReturn n*$10101
EndProcedure
Procedure.l QuickEvent(n)
n+ElapsedMilliseconds()
While n>ElapsedMilliseconds()
Select WaitWindowEvent(10)
Case #PB_Event_CloseWindow
ProcedureReturn #True
Case #WM_CHAR
If EventwParam()=27
ProcedureReturn #True
EndIf
EndSelect
Wend
ProcedureReturn #False
EndProcedure
Procedure Plate(index,old,new,phase)
Image(#NewValue)=CopyImage(#Plate,#NewValue)
StartDrawing(ImageOutput(#NewValue))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(Font)
Text=RSet(Str(new),2,"0")
; (ebs)
; add colon to hours and minutes
If index = #Seconds
Text + " "
Else
Text + ":"
EndIf
; (ebs)
DrawText((GX-TextWidth(Text))>>1,(GY-TextHeight(Text))>>1,Text,#White)
StopDrawing()
Image(#OldValue)=CopyImage(#Plate,#OldValue)
StartDrawing(ImageOutput(#OldValue))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(Font)
Text=RSet(Str(old),2,"0")
; (ebs)
; add colon to hours and minutes
If index = #Seconds
Text + " "
Else
Text + ":"
EndIf
; (ebs)
DrawText((GX-TextWidth(Text))>>1,(GY-TextHeight(Text))>>1,Text,#White)
StopDrawing()
StartDrawing(ImageOutput(index))
If phase<>#Phases
Image(#Drawboard)=GrabImage(#NewValue,#Drawboard,0,0,GX,G_M)
DrawImage(Image(#Drawboard),0,0)
Image(#Drawboard)=GrabImage(#OldValue,#Drawboard,0,G_M,GX,G_M)
DrawImage(Image(#Drawboard),0,G_M)
If phase<#Halftime
Image(#Drawboard)=GrabImage(#OldValue,#Drawboard,0,0,GX,G_M)
Image(#Drawboard)=ResizeImage(#Drawboard,GX,Size(phase))
DrawImage(Image(#Drawboard),0,G_M-Size(phase))
LineXY(0,G_M-Size(phase),GX,G_M-Size(phase),#BorderColor)
ElseIf phase>#Halftime
Image(#Drawboard)=GrabImage(#NewValue,#Drawboard,0,G_M,GX,G_M)
Image(#Drawboard)=ResizeImage(#Drawboard,GX,Size(phase))
DrawImage(Image(#Drawboard),0,G_M)
LineXY(0,G_M+Size(phase),GX,G_M+Size(phase),#BorderColor)
EndIf
Else
Image(index)=CopyImage(#NewValue,index)
EndIf
StopDrawing()
EndProcedure
Procedure Flip(hour,Minute,Second)
Protected n
For n=1 To #Phases
If hour<>#Undefined
Plate(#Hours,HourLast,hour,n)
SetGadgetState(#Hours,Image(#Hours))
EndIf
If Minute<>#Undefined
Plate(#Minutes,MinuteLast,Minute,n)
SetGadgetState(#Minutes,Image(#Minutes))
EndIf
If Second<>#Undefined
Plate(#Seconds,SecondLast,Second,n)
SetGadgetState(#Seconds,Image(#Seconds))
EndIf
If QuickEvent(#Delay)
Later=#Now
Break
EndIf
Next n
If hour<>#Undefined
HourLast=hour
EndIf
If Minute<>#Undefined
MinuteLast=Minute
EndIf
If Second<>#Undefined
SecondLast=Second
EndIf
EndProcedure
Procedure UpdateClock()
Protected HourNow,MinuteNow,SecondNow
Protected Clock=Date()
HourNow=Hour(Clock)
MinuteNow=Minute(Clock)
SecondNow=Second(Clock)
If HourLast=HourNow
HourNow=#Undefined
EndIf
If MinuteLast=MinuteNow
MinuteNow=#Undefined
EndIf
If SecondLast=SecondNow
SecondNow=#Undefined
EndIf
Flip(HourNow,MinuteNow,SecondNow)
EndProcedure
Procedure Init()
Protected i
; standard window with border
WinID=OpenWindow(#WinID,0,0,WX,WY,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
; borderless window (ebs)
;WinID=OpenWindow(#WinID,0,0,WX,WY,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_BorderLess)
; fullscreen window (ebs)
;WinID=OpenWindow(#WinID,0,0,0,0,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Maximize)
; black background (in case of maximized window)
SetWindowColor(#WinID, #Black)
;SetWindowColor(#WinID,$200000)
For i=#Hours To #Seconds
; position image gadgets in center of maximized window (ebs)
; (no effect on standard window)
ImageGadget(i,(WindowWidth(#WinID)-WX)/2 + OX+(GX+OZ)*i,(WindowHeight(#WinID)-WY)/2 + OY,GX,GY,0)
Next i
For i=#Hours To #Plate
Image(i)=CreateImage(i,GX,GY)
Next i
Font=LoadFont(#Numbers,"MS Trebuchet",GY*0.65,#PB_Font_Bold)
StartDrawing(ImageOutput(#Plate))
Box(0,0,G_X,G_Y,#Black)
For i=0 To G_M/3
c=Greyscale(i,G_M/3)
LineXY(0,i,G_X,i,c)
LineXY(0,i+G_M,G_X,i+G_M,c)
Next i
StopDrawing()
For i=1 To #Phases
Size(i)=Abs(Cos(i*#PI/#Phases)*G_M)
Next i
UpdateClock()
SetTimer_(WinID,0,1000,0)
HideWindow(#WinID,0)
EndProcedure
Procedure Main()
; (ebs)
; load "page flip" sound
InitSound()
; sound can be downloaded from http://www.soundjay.com/page-flip-sounds-2.html
LoadSound(0, "page-flip-16.wav")
; adjust volume
SoundVolume(0, 40)
; speed up to make it sound more like a "flip"
SoundFrequency(0, 100000)
; (ebs)
Init()
Repeat
Select WaitWindowEvent(100)
Case #PB_Event_CloseWindow
Later=#Now
Case #WM_TIMER
UpdateClock()
; play "flip" sound (ebs)
PlaySound(0)
EndSelect
Until Later
EndProcedure
Main()
I used sound page-flip-1.mp3 and changed the tone/pitch so the duration was about .3 sec (~ 3 times as fast) (in an old version of SoundStudio) and it sounds pretty good. The sound file only needs to be in the same location as the program.
Thanks ebs!
Code: Select all
; Clock by Michael Vogel
; Sound additions by ebs
;>>>>>> this version for Mac <<<<<<<
#Phases=10
#Halftime=#Phases>>1
#Delay=60
#Gray=$808080
#White=$FFFFFF
#Black=0
#BorderColor=#Gray
Enumeration
#Never
;
#Hours=0
#Minutes
#Seconds
#OldValue
#NewValue
#Drawboard
#Plate
;
#WinID
#Numbers
;
#Now
#Undefined=-1
EndEnumeration
Global WinID
; adjust window size for added colons (ebs)
Global WX=690
;Global WX=590
Global WY=200
; adjust window size for added colons (ebs)
Global GX=240
;Global GX=190
Global GY=190
Global G_X=GX-1
Global G_Y=GY-1
Global G_M=G_Y>>1
Global OX=5
Global OY=5
Global OZ=5
Global Later=#Never
Global HourLast=#Undefined
Global MinuteLast=#Undefined
Global SecondLast=#Undefined
Global Font
Global Dim Image(#Plate)
Global Text.s
Global Dim Size(#Phases)
; EndDefine
Procedure.l Greyscale(n,x)
n=x-n
n<<6
n/x
ProcedureReturn n*$10101
EndProcedure
Procedure.l QuickEvent(n)
n+ElapsedMilliseconds()
While n>ElapsedMilliseconds()
Select WaitWindowEvent(10)
Case #PB_Event_CloseWindow
ProcedureReturn #True
; Case #WM_CHAR
; If EventwParam()=27
; ProcedureReturn #True
; EndIf
EndSelect
Wend
ProcedureReturn #False
EndProcedure
Procedure Plate(index,old,new,phase)
Image(#NewValue)=CopyImage(#Plate,#NewValue)
StartDrawing(ImageOutput(#NewValue))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(Font)
Text=RSet(Str(new),2,"0")
; (ebs)
; add colon to hours and minutes
If index = #Seconds
Text + " "
Else
Text + ":"
EndIf
; (ebs)
;DrawText((GX-TextWidth(Text))>>1,(GY-TextHeight(Text))>>1,Text,#White)
DrawText(1,1,Text,#White)
StopDrawing()
Image(#OldValue)=CopyImage(#Plate,#OldValue)
StartDrawing(ImageOutput(#OldValue))
DrawingMode(#PB_2DDrawing_Transparent)
DrawingFont(Font)
Text=RSet(Str(old),2,"0")
; (ebs)
; add colon to hours and minutes
If index = #Seconds
Text + " "
Else
Text + ":"
EndIf
; (ebs)
;DrawText((GX-TextWidth(Text))>>1,(GY-TextHeight(Text))>>1,Text,#White)
DrawText(1,1,Text,#White)
StopDrawing()
StartDrawing(ImageOutput(index))
If phase<>#Phases
Image(#Drawboard)=GrabImage(#NewValue,#Drawboard,0,0,GX,G_M)
DrawImage(Image(#Drawboard),0,0)
Image(#Drawboard)=GrabImage(#OldValue,#Drawboard,0,G_M,GX,G_M)
DrawImage(Image(#Drawboard),0,G_M)
If phase<#Halftime
Image(#Drawboard)=GrabImage(#OldValue,#Drawboard,0,0,GX,G_M)
ResizeImage(#Drawboard,GX,Size(phase))
Image(#Drawboard)=ImageID(#Drawboard)
DrawImage(Image(#Drawboard),0,G_M-Size(phase))
LineXY(0,G_M-Size(phase),GX,G_M-Size(phase),#BorderColor)
ElseIf phase>#Halftime
Image(#Drawboard)=GrabImage(#NewValue,#Drawboard,0,G_M,GX,G_M)
ResizeImage(#Drawboard,GX,Size(phase))
Image(#Drawboard)=ImageID(#Drawboard)
DrawImage(Image(#Drawboard),0,G_M)
LineXY(0,G_M+Size(phase),GX,G_M+Size(phase),#BorderColor)
EndIf
Else
Image(index)=CopyImage(#NewValue,index)
EndIf
StopDrawing()
EndProcedure
Procedure Flip(hour,Minute,Second)
Protected n
For n=1 To #Phases
If hour<>#Undefined
Plate(#Hours,HourLast,hour,n)
SetGadgetState(#Hours,Image(#Hours))
EndIf
If Minute<>#Undefined
Plate(#Minutes,MinuteLast,Minute,n)
SetGadgetState(#Minutes,Image(#Minutes))
EndIf
If Second<>#Undefined
Plate(#Seconds,SecondLast,Second,n)
SetGadgetState(#Seconds,Image(#Seconds))
EndIf
If QuickEvent(#Delay)
Later=#Now
Break
EndIf
Next n
If hour<>#Undefined
HourLast=hour
EndIf
If Minute<>#Undefined
MinuteLast=Minute
EndIf
If Second<>#Undefined
SecondLast=Second
EndIf
EndProcedure
Procedure UpdateClock()
Protected HourNow,MinuteNow,SecondNow
Protected Clock=Date()
HourNow=Hour(Clock)
MinuteNow=Minute(Clock)
SecondNow=Second(Clock)
If HourLast=HourNow
HourNow=#Undefined
EndIf
If MinuteLast=MinuteNow
MinuteNow=#Undefined
EndIf
If SecondLast=SecondNow
SecondNow=#Undefined
EndIf
Flip(HourNow,MinuteNow,SecondNow)
EndProcedure
Procedure Init()
Protected i
; standard window with border
WinID=OpenWindow(#WinID,0,0,WX,WY,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
; borderless window (ebs)
;WinID=OpenWindow(#WinID,0,0,WX,WY,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_BorderLess)
; fullscreen window (ebs)
;WinID=OpenWindow(#WinID,0,0,0,0,"Flip Flop",#PB_Window_Invisible|#PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Maximize)
; black background (in case of maximized window)
SetWindowColor(#WinID, #Black)
;SetWindowColor(#WinID,$200000)
For i=#Hours To #Seconds
; position image gadgets in center of maximized window (ebs)
; (no effect on standard window)
ImageGadget(i,(WindowWidth(#WinID)-WX)/2 + OX+(GX+OZ)*i,(WindowHeight(#WinID)-WY)/2 + OY,GX,GY,0)
Next i
For i=#Hours To #Plate
Image(i)=CreateImage(i,GX,GY)
Next i
;Font=LoadFont(#Numbers,"MS Trebuchet",GY*0.65,#PB_Font_Bold)
Font=LoadFont(#Numbers,"Geneva",GY*0.65,#PB_Font_Bold)
StartDrawing(ImageOutput(#Plate))
Box(0,0,G_X,G_Y,#Black)
For i=0 To G_M/3
c=Greyscale(i,G_M/3)
LineXY(0,i,G_X,i,c)
LineXY(0,i+G_M,G_X,i+G_M,c)
Next i
StopDrawing()
For i=1 To #Phases
Size(i)=Abs(Cos(i*#PI/#Phases)*G_M)
Next i
UpdateClock()
;SetTimer_(WinID,0,1000,0)
HideWindow(#WinID,0)
EndProcedure
Procedure Main()
; (ebs)
; load "page flip" sound
If InitMovie()=0:MessageRequester("Loading InitMovie","Not possible"):EndIf ; InitSound()
; sound can be downloaded from http://www.soundjay.com/page-flip-sounds-2.html
If LoadMovie(0,"page-flip-1.aif")=0:MessageRequester("Loading sound..."," Not found"):EndIf
; I used page-flip-1.mp3 and changed the duration to .30 sec (about 3 times faster)
; LoadSound(0, "page-flip-16.wav")
; adjust volume
;SoundVolume(0, 40)
; speed up to make it sound more like a "flip"
;SoundFrequency(0, 100000)
; (ebs)
Init()
Repeat
Select WaitWindowEvent(100)
Case #PB_Event_CloseWindow
Later=#Now
; Case #WM_TIMER
; UpdateClock()
; ; play "flip" sound (ebs)
; PlaySound(0)
EndSelect
NewSecond=Second(Date())
If NewSecond<>OldSecond
UpdateClock()
PlayMovie(0,GetActiveWindow()) ; PlaySound(0)
OldSecond=NewSecond
EndIf
Until Later
EndProcedure
Main()
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
- Michael Vogel
- Addict
- Posts: 2807
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Hi,
just made a small demonstration which can be used as a screensaver.
Just some informations (and a question)...
• in "secure mode" you need to press "PUR" to get out (I don't tell you how to get in
)
• using the parameter "/*" (or "-*") will install the file as a screen saver
• I have problems to align the words PURE and BASIC vertically, because TextHeight() results are mysterious values - any tips?
Michael
just made a small demonstration which can be used as a screensaver.
Just some informations (and a question)...
• in "secure mode" you need to press "PUR" to get out (I don't tell you how to get in

• using the parameter "/*" (or "-*") will install the file as a screen saver
• I have problems to align the words PURE and BASIC vertically, because TextHeight() results are mysterious values - any tips?
Michael