draw

package
v0.0.0-...-9c8945c Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StrokeStyle is a attribute of type StrokeStyle
	StrokeStyle attribute = iota
	// FillStyle is a attribute of type FillStyle
	FillStyle
	// LineWidth is a attribute of type LineWidth
	LineWidth
	// Font is a attribute of type Font
	Font
	// TextBaseline is a attribute of type TextBaseline
	TextBaseline
	// GlobalAlpha is a attribute of type GlobalAlpha
	GlobalAlpha
	// StyleEnumSize is a attribute of type StyleEnumSize
	StyleEnumSize
)

Variables

This section is empty.

Functions

func Parseattribute

func Parseattribute(name string) (attribute, error)

Parseattribute attempts to convert a string to a attribute

Types

type Camera

type Camera struct {
	Zoom   float64
	Offset internal.Vector
}

func (Camera) Crop

func (*Camera) FitCenter

func (c *Camera) FitCenter(global internal.BoundingBox)

type Context

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

func GetContext

func GetContext(el js.Value) *Context

func (*Context) Arc

func (ctx *Context) Arc(x, y, radius, startAngle, endAngle float64)

func (*Context) BeginPath

func (ctx *Context) BeginPath()

func (*Context) Clear

func (ctx *Context) Clear(box internal.BoundingBox)

func (*Context) ClearRect

func (ctx *Context) ClearRect(x, y, w, h float64)

func (*Context) ClosePath

func (ctx *Context) ClosePath()

func (*Context) DrawImage

func (ctx *Context) DrawImage(src interface{}, x, y float64)

func (*Context) Fill

func (ctx *Context) Fill()

func (*Context) FillText

func (ctx *Context) FillText(text string, x, y float64)

func (*Context) Get

func (ctx *Context) Get(attr attribute) js.Value

func (*Context) LineTo

func (ctx *Context) LineTo(x, y float64)

func (*Context) MeasureFontHeight

func (ctx *Context) MeasureFontHeight() float64

func (*Context) MeasureTextWidth

func (ctx *Context) MeasureTextWidth(text string) float64

func (*Context) MoveTo

func (ctx *Context) MoveTo(x, y float64)

func (*Context) Pop

func (ctx *Context) Pop(attr attribute)

func (*Context) Push

func (ctx *Context) Push(attr attribute, value interface{})

func (*Context) Rect

func (ctx *Context) Rect(x, y, w, h float64)

func (*Context) Resize

func (ctx *Context) Resize(w, h float64)

func (*Context) Stroke

func (ctx *Context) Stroke()

type Renderer

type Renderer interface {
	Draw(ctx *Context, c *Camera)
}

Jump to

Keyboard shortcuts

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