Documentation ¶
Overview ¶
Package drawing abstracts away some of the draw2d complexities by being opinionated on how to do some tasks (like saving only png)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawLine ¶
func DrawLine(xo, yo, xe, ye float32, path *CanvasContext)
DrawLine from (xo, yo) to (xe, ye)
func DrawPoint ¶
func DrawPoint(x, y float32, path *CanvasContext)
Drawpoint will draw a point into the canvas
func DrawSquare ¶
func DrawSquare(xo, yo, xe, ye float32, path *CanvasContext)
DrawSquare will get a canvascontext and draw an empty square
Types ¶
type Canvas ¶
func (*Canvas) GetContext ¶
func (c *Canvas) GetContext() *CanvasContext
Get a new Graphic Context where to draw
type CanvasContext ¶
type CanvasContext struct { draw2dimg.GraphicContext // contains filtered or unexported fields }
func (CanvasContext) ToScale ¶
func (cnv CanvasContext) ToScale(x float32) float64
ToScale transforms the [0.0, 1.0) space into [0, canvas.size)
Click to show internal directories.
Click to hide internal directories.