Documentation ¶
Index ¶
- Variables
- func Arc(x, y, w, h float64, beg, end float64)
- func Background(c color.Color)
- func Canvas(w, h int)
- func Circle(x, y, d float64)
- func Ellipse(x, y, w, h float64)
- func Fill(c color.Color)
- func Line(x1, y1, x2, y2 float64)
- func Quad(x1, y1, x2, y2, x3, y3, x4, y4 float64)
- func Rect(x, y, w, h float64)
- func Run(setup, draw Func)
- func Square(x, y, s float64)
- func Stroke(c color.Color)
- func StrokeWidth(v float64)
- func Text(txt string, x, y float64)
- func TextSize(size float64)
- func Triangle(x1, y1, x2, y2, x3, y3 float64)
- type Buttons
- type Func
- type Proc
- func (p *Proc) Arc(x, y, w, h float64, beg, end float64)
- func (p *Proc) Background(c color.Color)
- func (p *Proc) Canvas(w, h int)
- func (p *Proc) Circle(x, y, d float64)
- func (p *Proc) Ellipse(x, y, w, h float64)
- func (p *Proc) Fill(c color.Color)
- func (p *Proc) Line(x1, y1, x2, y2 float64)
- func (p *Proc) Quad(x1, y1, x2, y2, x3, y3, x4, y4 float64)
- func (p *Proc) Rect(x, y, w, h float64)
- func (p *Proc) Run()
- func (p *Proc) Square(x, y, s float64)
- func (p *Proc) Stroke(c color.Color)
- func (p *Proc) StrokeWidth(v float64)
- func (p *Proc) Text(txt string, x, y float64)
- func (p *Proc) TextSize(size float64)
- func (p *Proc) Triangle(x1, y1, x2, y2, x3, y3 float64)
Constants ¶
This section is empty.
Variables ¶
var Event struct { Mouse struct { Pressed bool PrevPosition struct { X float64 Y float64 } Position struct { X float64 Y float64 } Buttons Buttons } }
Event is the current event pushed from the system.
Functions ¶
func Arc ¶
Arc draws an ellipsoidal arc centered at (x,y), with the provided width and height, and a path from the beg to end radians. Positive angles denote a counter-clockwise path.
func Background ¶
Background defines the background color for the painting area. The default color is transparent.
func Ellipse ¶
func Ellipse(x, y, w, h float64)
Ellipse draws an ellipse at (x,y) with the provided width and height.
func Quad ¶
func Quad(x1, y1, x2, y2, x3, y3, x4, y4 float64)
Quad draws a quadrilateral, connecting the 4 points (x1,y1), (x2,y2), (x3,y3) and (x4,y4) together.
func Rect ¶
func Rect(x, y, w, h float64)
Rect draws a rectangle at (x,y) with width w and height h.
func Run ¶
func Run(setup, draw Func)
Run executes the user functions setup and draw. Run never exits.
func StrokeWidth ¶ added in v0.2.0
func StrokeWidth(v float64)
StrokeWidth sets the size of the strokes.
Types ¶
type Proc ¶
Proc is a p5 processor.
Proc runs the bound Setup function once before the event loop. Proc then runs the bound Draw function once per event loop iteration.
func (*Proc) Arc ¶ added in v0.2.0
Arc draws an ellipsoidal arc centered at (x,y), with the provided width and height, and a path from the beg to end radians. Positive angles denote a counter-clockwise path.
func (*Proc) Background ¶ added in v0.2.0
Background defines the background color for the painting area. The default color is transparent.
func (*Proc) Canvas ¶ added in v0.2.0
Canvas defines the dimensions of the painting area, in pixels.
func (*Proc) Quad ¶
Quad draws a quadrilateral, connecting the 4 points (x1,y1), (x2,y2), (x3,y3) and (x4,y4) together.
func (*Proc) StrokeWidth ¶ added in v0.2.0
StrokeWidth sets the size of the strokes.