Computer Science Canada

Adding location values in font.draw in loops/Scroll bars?

Author:  Vissar [ Mon Nov 06, 2006 10:57 am ]
Post subject:  Adding location values in font.draw in loops/Scroll bars?

Is it possible to output text with font.draw so that when the loop gives it a new number, the text is moved so all the numbers are not overlapped?


This is the basic program. Very simple.

var number:int:=-100
loop
put number
number:=number+2
exit when number=100
end loop


That didn't work out too well for me so I tried a verticle scroll bar. That didn't work out either. The only thing the scroll bar did was make the loop restart ((I used the scroll bar code off the turing help)). There was no way to see the numbers at the top for more than a fraction of a second.

The goal here, basicly, is to make the output "look good" as my teacher so simply puts it. Any ideas?

Author:  Tony [ Mon Nov 06, 2006 11:18 am ]
Post subject: 

yes, Font.Draw takes x,y paremeters, so you can output text where-ever you want

Author:  Vissar [ Mon Nov 06, 2006 12:46 pm ]
Post subject: 

Tony wrote:
yes, Font.Draw takes x,y paremeters, so you can output text where-ever you want


Yes, I'm quite aware of this, but is it possible to make the looped outputs change the x, y parameters without having to manually do it myself 100 or so times?

Author:  ericfourfour [ Mon Nov 06, 2006 3:01 pm ]
Post subject: 

Easy. Each parameter (text, x, y, font, and colour) can be a variable. Just make x and y a variable and use them instead of hard coded values.

Author:  Piro24 [ Mon Nov 06, 2006 4:20 pm ]
Post subject: 

Try it out for youself...You can make the co-ordinates in Font.Draw variables so just apply what you have into your code for that...


: