Computer Science Canada

Scrolling Pictures

Author:  Goddog [ Sat Mar 15, 2003 7:40 pm ]
Post subject:  Scrolling Pictures

im trying to get pictures to scroll when arrows are hit, the scrolling works, i just need them to get back to the first one or the last one if they reach the end


procedure teamselection
cls
for row : 1 .. 25
colorback (100)
put repeat (" ", 80) ..
end for
Pic.Draw (teamchoose, 35, 0, 0)
Pic.Draw (cyclel, 50, maxy-50, 0)
Pic.Draw (cycler, 200, maxy-50, 0)
Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
% jorseypicture := Pic.FileNew(intsr(counter) + ``.bmp``)
%Pic.Draw (jorseypicture,maxx-200,maxy-170,0)
%Pic.Draw (toronto,maxx-170,maxy-65,0)
%Pic.Draw("logo" + intstr(counter) + ".jpg")
counter := 1
% counter1 := 1
jorseypicture := Pic.FileNew(intstr(counter) + ".jpg")
% logopicture := Pic.FileNew("logo" + intstr(counter1) + ".jpg")
Pic.Draw (bostonhome,55, maxy-170, 0)
% Pic.Draw (boston,85,maxy-65,0)
helper := 1
loop

mousewhere(n,m,button1)
%locate(1,1)
%put counter
%locate (2,1)
%put counter1
if counter = maxjorsey then
counter := 0
elsif counter = 1 then
counter := 7

end if
% if counter1 = 0 then
%counter1 := 0


%end if

%if helper = 1 then
%helper := 2
%counter := 6
%counter1 := 6
%end if
if n >= 50 and n <= 65 and m >= 350 and m <= 370 and button1 = 1 then

% counter1 := counter1+1
counter := counter+1
cls
Pic.Draw (teamchoose, 35, 0, 0)
Pic.Draw (cyclel, 50, maxy-50, 0)
Pic.Draw (cycler, 200, maxy-50, 0)
Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
jorseypicture := Pic.FileNew(intstr(counter) + ".jpg")
% logopicture := Pic.FileNew("logo" + intstr(counter1) + ".jpg")
% Pic.Draw (logopicture,85,maxy-65,0)
Pic.Draw (jorseypicture,55, maxy-170, 0)
delay(1000)
elsif n >= 200 and n <= 213 and m >= 350 and m <= 370 and button1 = 1 then

% counter1 := counter1-1
counter := counter-1
cls
Pic.Draw (teamchoose, 35, 0, 0)
Pic.Draw (cyclel, 50, maxy-50, 0)
Pic.Draw (cycler, 200, maxy-50, 0)
Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
jorseypicture := Pic.FileNew(intstr(counter) + ".jpg")
% logopicture := Pic.FileNew("logo" + intstr(counter1) + ".jpg")
% Pic.Draw (logopicture,85,maxy-65,0)
Pic.Draw (jorseypicture,55, maxy-170, 0)
delay(1000)


end if

end loop
end teamselection

Author:  Dan [ Sat Mar 15, 2003 8:05 pm ]
Post subject: 

code:

procedure teamselection
    cls
    for row : 1 .. 25
        colorback (100)
        put repeat (" ", 80) ..
    end for
    Pic.Draw (teamchoose, 35, 0, 0)
    Pic.Draw (cyclel, 50, maxy-50, 0)
    Pic.Draw (cycler, 200, maxy-50, 0)
    Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
    Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
    counter := 1
    jorseypicture := Pic.FileNew(intstr(counter) + ".jpg")
    Pic.Draw (bostonhome,55, maxy-170, 0)
    helper := 1
    loop
   
    mousewhere(n,m,button1)
  locate(1,1)
  put counter
  locate (2,1)
  put counter1
  if counter = 7 then
    counter := 1
    elsif counter = 0 then
    counter := 6
    end if
   
    jorseypicture := Pic.FileNew(intstr(counter) + ".jpg")
   
    if n >= 50 and n <= 65 and m >= 350 and m <= 370 and button1 = 1 then
   
 
    counter := counter+1
    cls
    Pic.Draw (teamchoose, 35, 0, 0)
    Pic.Draw (cyclel, 50, maxy-50, 0)
    Pic.Draw (cycler, 200, maxy-50, 0)
    Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
    Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
    Pic.Draw (jorseypicture,55, maxy-170, 0)
    delay(1000)
    elsif n >= 200 and n <= 213 and m >= 350 and m <= 370 and button1 = 1 then

    counter := counter-1
    cls
    Pic.Draw (teamchoose, 35, 0, 0)
    Pic.Draw (cyclel, 50, maxy-50, 0)
    Pic.Draw (cycler, 200, maxy-50, 0)
    Pic.Draw (cyclel1, maxx - 200, maxy-50, 0)
    Pic.Draw (cycler1, maxx - 50, maxy-50, 0)
   

    Pic.Draw (jorseypicture,55, maxy-170, 0)
    delay(1000)
   
   
    end if
   
    end loop
end teamselection


: