Author Topic: scrolling title display  (Read 150 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 261
  • Karma: 25
  • Hard players don't go home.
    • View Profile
scrolling title display
« on: March 05, 2019 »
Simple stand-alone scroll.
up/down D-pad to activate.

Code: [Select]
open window 640,512
restore bodyparts
read bodies
dim parts$(bodies)
dim prices(bodies)
dim listed(bodies)
for a=1 to bodies
read parts$(a)
read prices(a)
read listed(a)
next a
row=1
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
c=peek("port1")
row1=0
if and(c,16)<>0 up=1
if up=1 u=u+1
if u>2 u=2
if u=2 up=0
if and(c,16)=0 u=0

if and(c,64)<>0 down=1
if down=1 d=d+1
if d>2 d=2
if d=2 down=0
if and(c,64)=0 d=0

if up=1 row=row-1
if down=1 row=row+1
if row<1 row=1
if row>bodies row=bodies

for a=1 to bodies
if row=a text 20,180,parts$(a)
if row=a then
setrgb 1,0,256,0
else
setrgb 1,256,256,256
endif
text 100,a*15-(row*15-15)+165,parts$(a)
text 180,a*15+165,parts$(a)
next a

setrgb 1,256,256,256

for a=1 to bodies
if row=a then
space=20
else
space=0
endif
text 260+space,a*15+165,parts$(a)
next a

for a=1 to bodies
if row=a text 340,a*15+165,">"
text 350,a*15+165,parts$(a)
next a

for a=1 to bodies
if row=a then
text 430,180,parts$(a)
else
row1=row1+1
text 430,row1*15+200,parts$(a)
endif
next a

until (1=0)

label bodyparts
data 10
data "hand",7,1
data "mouth",10,1
data "ear",4,1
data "leg",9,1
data "arm",2,1
data "chest",3,0
data "elbow",5,0
data "knee",8,0
data "ankle",1,0
data "eye",6,0

have a yahappy day[/code]
« Last Edit: March 05, 2019 by bikemadness »
Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 8
    • View Profile
Re: scrolling title display
« Reply #1 on: March 20, 2019 »
Still coding for yabasic, nice work!