Author Topic: Text Rotate  (Read 1688 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 319
  • Karma: 25
  • Hard players don't go home.
    • View Profile
Text Rotate
« on: November 07, 2021 »
This is only a working concept of what I'm trying to do.

It's far from perfect.

Pivot the text at the highlighted letter.

L/R D-Pad to move the highlight.
U/D D-Pad to pivot.

Code: [Select]
a$="the quick brown fox jumps over the lazy dog"
open window 640,512
gap=10
x=100
y=260
dir=0
ang=pi/180
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")
go=go+1
if go>5 go=5
'if and(c,32)>0 gap=gap-1
'if and(c,128)>0 gap=gap+1
'if and(c,128)>0 x=x-10
'if and(c,32)>0 x=x+10
'if and(c,16)>0 y=y-10
'if and(c,64)>0 y=y+10
if and(c,16)>0 dir=dir+1
if and(c,64)>0 dir=dir-1
if dir<0 dir=359
if dir>359 dir=0
if and(c,32)>0 and go=5 then
go=1
jump=jump+1
endif
if and(c,128)>0 and go=5 then
go=1
jump=jump-1
endif
if jump>len(a$) jump=len(a$)
if jump<1 jump=1
for a=1 to len(a$)
if jump=a then
setrgb 1,256,0,0
else
setrgb 1,256,256,256
endif
'x1=(cos(ang*dir)*a*gap)+x
'y1=(sin(ang*dir)*a*gap)+y
x1=(cos(ang*dir)*(a-jump)*gap)+x
y1=(sin(ang*dir)*(a-jump)*gap)+y
text x1+(jump*gap),y1,mid$(a$,a,1)
next a
until (1=0)
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.