Animation: Difference between revisions

Content added Content deleted
(Added Liberty BASIC example)
(Edited LB example)
Line 570: Line 570:
=={{header|Liberty BASIC}}==
=={{header|Liberty BASIC}}==
<lang lb> txt$ = "Hello World! "
<lang lb> txt$ = "Hello World! "
txtLength = len(txt$)
direction=1
direction=1

NoMainWin


open "Rosetta Task: Animation" for graphics_nsb as #demo
open "Rosetta Task: Animation" for graphics_nsb as #demo
#demo "Trapclose [quit]"
#demo "Trapclose [quit]"
#demo "down ; Font Verdana 20 Bold"
#demo "down"
#demo "Font Verdana 20 Bold"
#demo "When leftButtonUp [changedirection]"
#demo "When leftButtonUp [changedirection]"


Line 580: Line 584:
wait
wait


[draw]
[draw]
if direction then
if direction then
txt$ = right$(txt$, 1);left$(txt$, 12)
txt$ = right$(txt$, 1);left$(txt$, txtLength - 1)
else
else
txt$ = right$(txt$, 12);left$(txt$, 1)
txt$ = right$(txt$, txtLength - 1);left$(txt$, 1)
end if
end if
#demo "discard ; place 50 100 ;\";txt$
#demo "discard"
#demo "place 50 100"
#demo "\";txt$
wait
wait


[changedirection]
[changedirection]
direction = not(direction)
direction = not(direction)
wait
wait


[quit]
[quit]
timer 0
timer 0
close #demo
close #demo