drawille

package
v0.0.0-...-65d76af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2020 License: AGPL-3.0, AGPL-3.0 Imports: 1 Imported by: 7

README

GO-DRAWILLE

Drawing in the terminal with Unicode Braille characters. A go port of asciimoo's drawille

LICENSE
drawille-go 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-go 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-go. If not, see < http://www.gnu.org/licenses/ >.

(C) 2014 by Adam Tauber, <asciimoo@gmail.com>
(C) 2014 by Jacob Hughes, <exrook.j@gmail.com>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	LineEnding string
	// contains filtered or unexported fields
}

func NewCanvas

func NewCanvas() Canvas

Make a new canvas

func (*Canvas) Clear

func (c *Canvas) Clear()

Clear all pixels

func (*Canvas) DrawLine

func (c *Canvas) DrawLine(x1, y1, x2, y2 int)

DrawLine draws a line onto the Canvas

func (*Canvas) DrawPolygon

func (c *Canvas) DrawPolygon(center_x, center_y, sides, radius float64)

func (Canvas) Frame

func (c Canvas) Frame(minX, minY, maxX, maxY int) string

Frame retrieves a string representation of the frame at the given parameters

func (Canvas) Get

func (c Canvas) Get(x, y int) bool

Get pixel at the given coordinates

func (Canvas) GetCharacter

func (c Canvas) GetCharacter(x, y int) rune

GetCharacter gets character for the given pixel

func (Canvas) GetScreenCharacter

func (c Canvas) GetScreenCharacter(x, y int) rune

GetScreenCharacter gets character at the given screen coordinates

func (Canvas) MaxX

func (c Canvas) MaxX() int

func (Canvas) MaxY

func (c Canvas) MaxY() int

func (Canvas) MinX

func (c Canvas) MinX() int

func (Canvas) MinY

func (c Canvas) MinY() int

func (Canvas) Rows

func (c Canvas) Rows(minX, minY, maxX, maxY int) []string

Rows retrieves the rows from a given view

func (*Canvas) Set

func (c *Canvas) Set(x, y int)

Set a pixel of c

func (*Canvas) SetText

func (c *Canvas) SetText(x, y int, text string)

Set text to the given coordinates

func (Canvas) String

func (c Canvas) String() string

func (*Canvas) Toggle

func (c *Canvas) Toggle(x, y int)

Toggle a point

func (*Canvas) UnSet

func (c *Canvas) UnSet(x, y int)

Unset a pixel of c

type Point

type Point struct {
	X, Y int
}

func Line

func Line(x1, y1, x2, y2 int) []Point

Line returns []Point where each Point is a dot in the line

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL