Skip to content

Modern Tui TuiCanvas Line

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Charts › TuiCanvas.Line_

TuiCanvas.Line_

Draws a straight line of dots between two points.

Syntax

TuiCanvas.Line_( byval x0 as int32, byval y0 as int32, byval x1 as int32, byval y1 as int32, byval c as TuiColor )

Description

A Bresenham line in dot coordinates. The underscore is because LINE is a statement. This is what joins consecutive samples in a braille graph, which is why the plot looks continuous rather than dotted.

Example

#import "std/tui"
using tui

dim as TuiCanvas cv = TuiCanvas( 20, 5 )       '' 40 x 20 dots
cv.Line_( 0, 0, 39, 19, TuiRgb( 200, 80, 80 ) )
print cv.Pattern( 0, 0 ) <> 0      '' -1 (true)  -- it starts here
print cv.Pattern( 19, 4 ) <> 0     '' -1 (true)  -- and ends here

See also

TuiCanvas TuiCanvas.Dot TuiCanvas.DotHeight TuiCanvas.Pattern
TuiCanvas.Resize TuiCanvas.Blit TuiCanvas.CellCols TuiSeries
TuiCanvas.Clear TuiCanvas.DotWidth TuiCanvas.CellRows TuiGraph

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Charts
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally