Dim a
Dim min1
Dim hr1
Dim sec1
'Initializes clock and tells it how to behave, when to start animation, etc
Sub window_onload
a = time
min1 = minute(time)
hr1 = hour(time)
if hr1 > 12 then
hr1 = hr1 - 12
end if
sec1 = second(time)
call sgSecondHand.Rotate(0,0,sec1*6 - 90)
call sgMinuteHand.Rotate(0,0,min1*6 - 90)
call sgHourHand.Rotate(0,0,hr1*360/12 - 90)
call seq("Time").Play
end Sub
'Sequencer initilization
Sub Seq_OnInit
Call seq("Time").at(0.000, "SecRot", -1, 1.000, 1)
Call seq("Time").at(60.000, "MinRot", -1, 60.000, 1)
Call seq("Time").at(0.000, "HourRot", -1, 1800.000, 1)
End Sub
'rotates second hand of clock
Sub SecRot
Call sgSecondHand.Rotate(0,0,6)
End Sub
' rotates minute hand of clock
Sub MinRot
Call sgMinuteHand.Rotate(0,0,6)
End Sub
' rotates hour hand of clock
Sub HourRot
Call sgHourHand.Rotate(0,0,15)
End Sub
ليست هناك تعليقات