Here's a demo video: https://odysee.com/@Electroguard:d/ZoomClock:2
Code: [Local Link Removed for Guests]
'Resizable Repositional Zoom Clock - radius = 20 * zoom factor z
'zoom factor can be from around 0.5 with fine-tuning to 11 for 640x480
pad=10 ' padding from edge
z=1: r=(20*z)+0: x=(640/2)-1: y=(480/2) 'Middle Small
'z=3: r=(20*z)+0: x=(640/2)-1: y=(480/2) 'Middle Medium
'z=11: r=(20*z)+0: x=(640/2)-1: y=(480/2) 'Middle Big
'z=1.5: r=(20*z)+0: x=(640/2)-1: y=479-(r)-pad 'Bottom
'z=6: r=(20*z)+0: x=(640/2)-1: y=0+(r)+pad 'Top
'z=0.7: r=(20*z)+0: x=pad+r: y=0+(r)+pad 'Top Left
'z=2: r=(20*z)+0: x=640-r-pad: y=480-(r)-pad 'Bottom Right
vga.pinout 17,18,8, 12,13,14, 21,47, 1,2
vga.delete
vga.init 2, 3 '640x480 3 buffers
vga.writePage 0 ' active
act = 1
vga.writePage act ' active
for c=1 to 360 step 30
vga.needle x, y, 20*z, c-1, darkcyan,3 'hours marker colour can either be "luminous" darkcyan or perimeter circle colour
next c
vga.circle x,y,r-4,black,1 'same as backround fill colour
vga.circle x,y,r+3,blue,0 'clock perimeter circle
vga.showPage act ' display
vga.copy 1, 2 ' copy the image from the buffer 1 to the buffer 2
i = 0
timer0 1000, update_clock
wait
update_clock:
buf = (i and 1)
vga.copy 2, buf ' copy the image from the buffer 2 to the buffer buf
vga.WritePage buf' active
t = timeunix(time$)
h = (t / 3600 ) mod 12
m = (t / 60) mod 60
s = t mod 60
vga.needle x, y, 13*z, h*30 +180 , green, 2 'hours hand
vga.needle x, y, 17*z, m*6 +180 , yellow, 2 'mins hand
vga.needle x, y, 20*z, s*6 +180 , red, 2 'secs - looks better if thickness=1, but becomes invisible just above horizontal
vga.circle x,y,2,red,1
vga.showPage buf ' display
inc i
return
end