397
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
method draws a line between any points.
and
draw vertical and horizontal lines correspondingly. Use the last two
methods whenever possible because they work faster than generic lcd.line. The
line is drawn using the color set in the
), and the line width is defined by the
property. In
the following example, we draw a picture as shown above, on the left:
lcd.forecolor=color_blue
'we assume we have already set color_blue
lcd.verline(0,0,20)
'vertical line, width=1 (default)
lcd.horline(0,20,0)
'horizontal line, width=1 (default)
lcd.linewidth=3
'change the width
lcd.line(2,2,20,20)
'line at 45 degrees, width=3
Defining lcd.linewidth>1 (3 for one of the lines in the above example) creates
"fatter" lines. Notice how two points of the line are drawn and where each specified
coordinate actually is.
Rectangles
draws an unfilled rectangle using lcd.forecolor as "pen" color, and
pen width defined by the lcd.linewidth property.
will
additionally paint the internal area using lcd.backcolor. Example and its result:
lcd.forecolor=color_blue
'we assume we have already set color_blue
lcd.backcolor=color_green
'we assume we have already set color_green
lcd.rectangle(0,0,20,20)
'width=1 (default)
lcd.linewidth=3
lcd.filledrectangle(5,5,15,15)
'width=3, filled with background color
Fills
paints specified area with the lcd.forecolor:
lcd.forecolor=color_blue
'we assume we have already set color_blue
lcd.fill(0,0,16,16)
lcd.forecolor=color_green
'we assume we have already set color_green
lcd.fill(5,5,16,16)
Working With Text
and
display text. The text is printed using the
selected font. This means you need to have at least one font file in your project
(see how to
a file), and have this font selected before you can print
anything.
is used to select the font:
romfile.open("Tibbo-5x7(VP).bin")
lcd.setfont(romfile.offset)
Note that lcd.setfont will return 1- NG if you try to feed it a wrong file!
422
432
421
419
395
423
427
418
417
425
426
128
428