Liberty BASIC Community Forum
« CountDown indicator similiar old movie »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 7:45pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: CountDown indicator similiar old movie  (Read 93 times)
xtal
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 28
xx CountDown indicator similiar old movie
« Thread started on: Jan 11th, 2018, 3:26pm »

I was looking for a dis-tractor while supplying a delay, and came up with this....



Code:
[WindowSetup]
  NOMAINWIN                                                          '    allow no print window
    WindowWidth = 1020 : WindowHeight = 700   '877
global oldx, oldy
graphicbox  #main.Plot3, 476, 235, 525,405                             ' home is 0,405

Open "Liberty Basic GRBL GUI" for Window as #main                      '
   #main "trapclose [quit]"                                           '
   cxx=261 : cyy=201 : Rl=70 : Rc = 80                                   ' x,y center & Radius & PI
   #main.Plot3,"down; home; posxy cxx cyy"                     ' circle line size
   oldx=cxx : oldy=cyy
   #main.Plot3,"color black; font arial 80"                                         '

 for zzz= 5 to 0 step -1
   if zzz=0 then
     Q=Ln1(Rl,Rc,cxx,cyy,zzz,"green")
   else
     Q=Ln1(Rl,Rc,cxx,cyy,zzz,"black")
   end if
 next zzz

[quit]
timer 2000,[xit]
wait
[xit]
 close #main
 end
'==================================================================================================================
function Ln1(Rl,Rc,cxx,cyy,zzz,Z$)                         '  LINE AND CIRCLE COUNT DOWN
       PI=acs(-1)                                          '
       for t=3*PI to PI step PI/-60  '  CW top^            ' for t=PI to 3*PI step PI/60  '  CCW top^
       'for t=0 to 2*PI step PI/60   '  CCW bottom v       ' for t=2*PI to 0 step PI/-60  '  CW  bottom v
        ry=(Rc)*cos(t)+cyy                                 '  Y CIRCLE COMPUTE
        rx=(Rc)*sin(t)+cxx                                 '  X CIRCLE COMPUTE
 ' UN REM the next 2 lines for interesting pattern------------------------------------------------------------------
 '  y=Rl*cos(t)+cyy : oldy=y                               '  Y  LINE COMPUTE & SAVE
 '  x=Rl*sin(t)+cxx : oldx=x                               '  X  LINE COMPUTE & SAVE
        #main.Plot3,"size 2; color white"                  '
        #main.Plot3,"home; goto ";oldx;" ";oldy            '  ERASE PREVIOUS LINE
        y=Rl*cos(t)+cyy : oldy=y                           '  Y  LINE COMPUTE & SAVE
        x=Rl*sin(t)+cxx : oldx=x                           '  X  LINE COMPUTE & SAVE
        #main.Plot3,"color black; home; goto ";x;" "; y    '  DRAW NEWLINE size 2
        #main.Plot3,"size 10; color ";Z$                   '  SETUP CIRCLE size 10
        #main.Plot3,"set ";rx;" ";ry                       '  PLOT CIRCLE
        #main.Plot3, "place 231 242; size 2; color black"  '  Place NUMBER
        #main.Plot3, "\";zzz                               '  DISPLAY NUMBER
        td=time$("ms")+9                                   '  Attempt 1 second delay
        while time$("ms") < td                             '  Attempt 1 second delay
        wend                                               '  Attempt 1 second delay
      next t                                               '
        #main.Plot3,"size 2; color white"                  '  SETUP LAST LINE  'CLEANUP
        #main.Plot3,"home; goto ";oldx;" ";oldy            '  ERASE LAST LINE  'CLEANUP
        #main.Plot3, "place 231 242; size 2; color black " '  SETUP DIGET      'CLEANUP
        #main.Plot3, "\";zzz                               '  DISPLAY DIGIT    'CLEANUP
end function                                               '
'------------------------------------------------------------------------------------------------------------------

 
User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1732
xx Re: CountDown indicator similiar old movie
« Reply #1 on: Jan 12th, 2018, 12:24am »

Nice effect, thanks.
Alternating color ring:
Code:
 colr$="black white black white black white black white "
 for zzz= 5 to 0 step -1
   if zzz=0 then
     Q=Ln1(Rl,Rc,cxx,cyy,zzz,"green")
   else
     Q=Ln1(Rl,Rc,cxx,cyy,zzz,word$(colr$, zzz))
   end if
 next zzz 
User IP Logged

damned Dog in the Manger
BeeTrap
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 22
xx Re: CountDown indicator similiar old movie
« Reply #2 on: Jan 12th, 2018, 08:20am »

Thanks for this. I will use this as a "progress indicator". I don't like programs that don't let the user know if it is running properly or just idle for no reason.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls