Home

Awesome

Lua-DRAWILLE

Generic badge Generic badge Generic badge Generic badge

Draw graphics on the terminal with Braille charakters. Implements a small graphics kernel with a handfull of useful routines, like Line Bresenham and Ellipse, light 3D support and Turtle Graphics.

Additionally the PGL "Primitive Graphics Language", that will plot a graph from a string and that is supported by the implementation of a Lindenmayer algorithm to create fractals. Implementing a nice little Conway's Game of Life as an example.

Lua implementation of drawille Version 2.0 of drawille

Usage

Canvas = require "drawille"

local c = Canvas.new()

for i=0,360*4 do
    if (i % 15) == 0 then
        c:set(i/15, math.floor(math.sin(i*(math.pi/180))*4))
    end
end

print(c:frame())

Rotating Cube Lines Polygon Random Colors Turtle Graphics Hilbert Curve Sierpinski Triangle Lindenmayer Tree Game of Life

Usage with Colors

Note: Color Resolution is peer Character, not per Subpixel of the [Braille][] characters. [Braille]: http://en.wikipedia.org/wiki/Braille For usage with Curses see Examples.

Canvas = require "drawille"

local c = Canvas.new()
c.esccodes = true
for i=0,360*4 do
    if (i % 15) == 0 then
        local r = math.random(0,255)
        local g = math.random(0,255)
        local b = math.random(0,255)
        c:set(i/15, math.floor(math.sin(i*(math.pi/180))*4),r,g,b)
    end
end

print(c:frame())

Sine

Added features with 2.0

Dependings

ToDo

Video Tutorials

Bugs

Bugs or suggestions? Visit the issue tracker.

Tested with

Not correctly showing on

LICENSE

drawille is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

drawille is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with drawille. If not, see < http://www.gnu.org/licenses/ >.

(C) 2014- by Adam Tauber, <asciimoo@gmail.com>
(CC) 2018 by Hanno Behrens, <behrens[DOT]hanno[AT]gmail[DOT]com>