canvas

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	js.Value
}

func (Context) Context2D

func (context Context) Context2D() Context2D

type Context2D

type Context2D struct {
	// contains filtered or unexported fields
}

func (Context2D) Arc

func (context Context2D) Arc(x, y, r int, sAngle, eAngle float64)

func (Context2D) ArcTo

func (context Context2D) ArcTo(x1, y1, x2, y2, r int)

func (Context2D) BeginPath

func (context Context2D) BeginPath()

func (Context2D) BezierCurveTo

func (context Context2D) BezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y int)

BezierCurveTo adds a point to the current path by using the specified control points that represent a cubic Bézier curve.

func (Context2D) Clip

func (context Context2D) Clip()

func (Context2D) ClosePath

func (context Context2D) ClosePath()

func (Context2D) Fill

func (context Context2D) Fill()

func (Context2D) FillStyle

func (context Context2D) FillStyle() string

func (Context2D) GlobalAlpha

func (context Context2D) GlobalAlpha() float64

GlobalAlpha returns the current alpha or transparency value of the drawing

func (Context2D) GlobalCompositeOperation

func (context Context2D) GlobalCompositeOperation() string

func (Context2D) IsPointInPath

func (context Context2D) IsPointInPath(x int, y int) bool

IsPointInPath returns true if the specified point is in the current path

func (Context2D) Line

func (context Context2D) Line() Line

func (Context2D) LineTo

func (context Context2D) LineTo(x int, y int)

func (Context2D) MoveTo

func (context Context2D) MoveTo(x int, y int)

func (Context2D) QuadraticCurveTo

func (context Context2D) QuadraticCurveTo(cpx, cpy, x, y int)

QuadraticCurveTo adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.

func (Context2D) Rectangle

func (context Context2D) Rectangle(x, y, width, height int) Rectangle

func (Context2D) Rotate

func (context Context2D) Rotate(angle float64)

Rotate rotates the current drawing

func (Context2D) Scale

func (context Context2D) Scale(x float64, y float64)

Scale scales the current drawing bigger or smaller

func (Context2D) SetFillStyle

func (context Context2D) SetFillStyle(value string)

func (Context2D) SetGlobalAlpha

func (context Context2D) SetGlobalAlpha(value float64)

func (Context2D) SetGlobalCompositeOperation

func (context Context2D) SetGlobalCompositeOperation(value string)

func (Context2D) SetStrokeStyle

func (context Context2D) SetStrokeStyle(value string)

func (Context2D) Shadow

func (context Context2D) Shadow() Shadow

func (Context2D) Stroke

func (context Context2D) Stroke()

func (Context2D) StrokeStyle

func (context Context2D) StrokeStyle() string

func (Context2D) Text

func (context Context2D) Text() Text

func (Context2D) Transform

func (context Context2D) Transform(a, b, c, d, e, f float64)

Transform replaces the current transformation matrix. a: Horizontal scaling b: Horizontal skewing c: Vertical skewing d: Vertical scaling e: Horizontal moving f: Vertical moving

func (Context2D) Translate

func (context Context2D) Translate(x float64, y float64)

Translate remaps the (0,0) position on the canvas

type Line

type Line struct {
	// contains filtered or unexported fields
}

func (Line) Cap

func (context Line) Cap() string

func (Line) Draw

func (context Line) Draw(x1, y1, x2, y2 int)

func (Line) Join

func (context Line) Join() string

func (Line) MiterLimit

func (context Line) MiterLimit() string

func (Line) SetCap

func (context Line) SetCap(value string)

func (Line) SetJoin

func (context Line) SetJoin(value string)

func (Line) SetMiterLimit

func (context Line) SetMiterLimit(value string)

func (Line) SetWidth

func (context Line) SetWidth(value int)

func (Line) Width

func (context Line) Width() int

type Rectangle

type Rectangle struct {
	// contains filtered or unexported fields
}

func (Rectangle) Cleared

func (rect Rectangle) Cleared() Rectangle

func (Rectangle) Draw

func (rect Rectangle) Draw()

func (Rectangle) Filled

func (rect Rectangle) Filled() Rectangle

func (Rectangle) Rounded

func (rect Rectangle) Rounded(radius int) Rectangle

func (Rectangle) Stroked

func (rect Rectangle) Stroked() Rectangle

type Shadow

type Shadow struct {
	// contains filtered or unexported fields
}

func (Shadow) Blur

func (context Shadow) Blur() float64

func (Shadow) Color

func (context Shadow) Color() string

func (Shadow) OffsetX

func (context Shadow) OffsetX() float64

func (Shadow) OffsetY

func (context Shadow) OffsetY() float64

func (Shadow) SetBlur

func (context Shadow) SetBlur(value float64)

func (Shadow) SetColor

func (context Shadow) SetColor(value string)

func (Shadow) SetOffsetX

func (context Shadow) SetOffsetX(value float64)

func (Shadow) SetOffsetY

func (context Shadow) SetOffsetY(value float64)

type Text

type Text struct {
	// contains filtered or unexported fields
}

func (Text) Align

func (context Text) Align() string

func (Text) Baseline

func (context Text) Baseline() string

func (Text) Fill

func (context Text) Fill(text string, x, y, maxWidth int)

func (Text) Font

func (context Text) Font() string

func (Text) SetAlign

func (context Text) SetAlign(value string)

func (Text) SetBaseline

func (context Text) SetBaseline(value string)

func (Text) SetFont

func (context Text) SetFont(value string)

func (Text) Stroke

func (context Text) Stroke(text string, x, y, maxWidth int)

func (Text) Width

func (context Text) Width(text string) int

Jump to

Keyboard shortcuts

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