woops
what happened there?
Anyhow:
` -------------------------------------------------------------------------
` Roll-over Text Change DarkForge FAQ 21/12/2000
` -------------------------------------------------------------------------
` Coded for a forum request in 10 mins one evening to show how to do a
` text roll-over without any sprite collision or complicated arrays.
hide mouse
` Create a basic new mouse pointer (image 1)
ink rgb(0,255,0),0
line 8,0,8,16
line 0,8,16,8
get image 1,0,0,17,17
` Create a basic new roll-over mouse pointer (image 2)
cls 0
circle 5,5,5
get image 2,0,0,16,16
data$="hello"
tx=200
ty=150
tw=text width(data$)
th=text height(data$)
rollover=1
do
cls rgb(0,0,50)
sprite 1,mousex(),mousey(),rollover
if mousex()>=tx and mousex()<=tx+tw and mousey()>=ty and mousey()<=ty+th
ink rgb(255,0,0),0
rollover=2
if mouseclick()
data$="goodbye"
endif
else
ink rgb(255,255,255),0
rollover=1
endif
text tx,ty,data$
loop
thats the code and I want to turn it into a function.
This is what I came up with that was not right and didn't work
:
function link(tx,ty,data1a$,data2a$)
rollover=1
cls rgb(0,0,50)
if mousex()>=tx and mousex()<=tx+tw and mousey()>=ty and mousey()<=ty+th
ink rgb(255,0,0),0
rollover=2
if mouseclick()
text data2a$
enif
else
ink rgb(255,255,255),0
rollover=1
endif
d
text tx,ty,data$
endfunction
Think you could correct this?
Thanks for any help