27 lines
674 B
Plaintext
27 lines
674 B
Plaintext
str$="Hello, World! "
|
|
direction=0 #value of 0: to the right, 1: to the left.
|
|
tlx=10 #Top left x
|
|
tly=10 #Top left y
|
|
fastgraphics
|
|
font "Arial",20,100 #The Font configuration (Font face, size, weight)
|
|
|
|
main:
|
|
while clickb=0
|
|
if direction=0 then
|
|
str$=RIGHT(str$,1) + LEFT(str$,length(str$)-1)
|
|
else
|
|
str$=MID(str$,2,length(str$)-1)+LEFT(str$,1)
|
|
end if
|
|
refresh
|
|
clg
|
|
color red
|
|
text tlx,tly,str$
|
|
pause .1
|
|
end while
|
|
#Note: textheight() and textwidth() depends on the latest configuration of the FONT command.
|
|
if clickb=1 and clickx>=tlx and clickx<=tlx+textwidth(str$) and clicky>=tly and clicky<=tly+textheight() then
|
|
direction=NOT direction
|
|
end if
|
|
clickclear
|
|
goto main
|