|
Post by tsh73 on Apr 10, 2019 17:30:48 GMT
That's not documented - but it looks like one could programmatically scroll graphicbox. May be someone will find use for it ' nomainwin
pi=acs(-1) rad=pi/180
graphicbox #main.gr, 50, 50, 200, 200 open "test" for window as #main
#main "trapclose [quit]" #main.gr "down"
'should be on before drawing or "home" gives different point! #main.gr "vertscrollbar on " #main.gr "horizscrollbar on "
#main.gr "home; circle 10" #main.gr "home; circle 30" #main.gr "home; circle 50" #main.gr "home; circle 70"
#main.gr "flush" #main.gr "rule xor"
timer 100, [tick] wait
[quit] timer 0 close #main end
[tick] if a<>0 then 'clear #main.gr "north; turn "; a #main.gr "home; go 100" end if 'scroll x=-10+80*cos(3*a*rad/2) 'offsets by trial and errors y=-10+80*sin(2*a*rad/2) #main.gr "vertscrollbar on ";y;" ";y #main.gr "horizscrollbar on ";x;" ";x
'draw a=a+15 #main.gr "north; turn "; a #main.gr "home; go 100" wait
(btw it could be done on graphicwindow as well) ' nomainwin
pi=acs(-1) rad=pi/180
open "test" for graphics as #gr #gr "trapclose [quit]" #gr "down"
#gr "home; circle 10" #gr "home; circle 30" #gr "home; circle 50" #gr "home; circle 70"
#gr "flush" #gr "rule xor"
timer 100, [tick] wait
[quit] timer 0 close #gr end
[tick] if a<>0 then 'clear #gr "north; turn "; a #gr "home; go 100" end if 'scroll x=50+50*cos(3*a*rad) y=50+50*sin(2*a*rad) #gr "vertscrollbar on ";y;" ";y #gr "horizscrollbar on ";x;" ";x
'draw a=a+15 #gr "north; turn "; a #gr "home; go 100" wait
|
|