Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas interface { // Clear ensures a given rectangle on the canvas is empty, // ready for drawing to. Clear(rect image.Rectangle) error // Draw draws a line between two points on the canvas. // The points should be provided in grid space. Draw(a, b Point) error // WaitForQuit blocks until the canvas has exited. WaitForQuit() }
type PaperCanvas ¶
type PaperCanvas struct {
Canvas
}
func NewPaperCanvas ¶
func NewPaperCanvas(gridWidth, gridHeight int) (sc PaperCanvas)
TODO: Implement me!
func (*PaperCanvas) Clear ¶
func (sc *PaperCanvas) Clear(rect image.Rectangle) error
TODO: Implement me! Block until complete.
func (*PaperCanvas) Draw ¶
func (sc *PaperCanvas) Draw(a, b Point) error
TODO: Implement me! Block until complete.
type ScreenCanvas ¶
type ScreenCanvas struct { Canvas // contains filtered or unexported fields }
func NewScreenCanvas ¶
func NewScreenCanvas(gridWidth, gridHeight int) (sc ScreenCanvas)
NewScreenCanvas creates a new ScreenCanvas.
func (*ScreenCanvas) Clear ¶
func (sc *ScreenCanvas) Clear(rect image.Rectangle) error
Clear overwrites the entire canvas with a white background. The rectangle to clear is ignored, but an error is returned if the rectangle is larger than the drawable area.
func (*ScreenCanvas) Draw ¶
func (sc *ScreenCanvas) Draw(a, b Point) error
Draw draws a line between two points in grid space on the canvas. The points are converted from grid space to canvas space.
func (*ScreenCanvas) WaitForQuit ¶
func (sc *ScreenCanvas) WaitForQuit()
Click to show internal directories.
Click to hide internal directories.