utils

package
v0.0.0-...-0bea188 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewText

func NewText(content string, fgColor color.RGBA64, fontSize float64, fontName string) logogen.Text

NewText returns a new logogen.Text instance w/o an error, ie when a font error is encountered the Default font is used

Types

type DrawingOptions

type DrawingOptions struct {
	Scale      float64
	Rotation   float64
	StartPoint shapes.Point2
}

DrawingOptions represents polygon drawing options

func NewDrawingOptions

func NewDrawingOptions(scale, rotation float64, startingPoint shapes.Point2) *DrawingOptions

NewDrawingOptions returns DrawingOptions

type PolygonDrawer

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

PolygonDrawer draws a polygon on a given cairo.Surface

func NewPolygonDrawer

func NewPolygonDrawer(polygon shapes.Polygon, polygonColor color.Color,
	drawingOptions *DrawingOptions, surface *cairo.Surface) *PolygonDrawer

NewPolygonDrawer returns a new PolygonDrawer instance

func (*PolygonDrawer) DrawFill

func (d *PolygonDrawer) DrawFill()

DrawFill draws the polygon on the given surface with fill

func (*PolygonDrawer) DrawStroke

func (d *PolygonDrawer) DrawStroke()

DrawStroke draws the polygon on the given surface with stroke

func (*PolygonDrawer) GetPolygon

func (d *PolygonDrawer) GetPolygon() shapes.Polygon

type PolygonGenerator

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

PolygonGenerator generates the inner regular polygon of the given circumferting circle

func NewPolygonGenerator

func NewPolygonGenerator(numSides int, circumfertingCircle *shapes.Circle, rotationAngle ...float64) (p *PolygonGenerator)

NewPolygonGenerator returns a new PolygonGenerator instance

func (*PolygonGenerator) GeneratePolygon

func (p *PolygonGenerator) GeneratePolygon() *shapes.RegPolygon

GeneratePolygon generate a polygon with the given stuff

func (*PolygonGenerator) ResetPolygon

func (p *PolygonGenerator) ResetPolygon()

ResetPolygon resets the polygon

func (*PolygonGenerator) SetPolygon

func (p *PolygonGenerator) SetPolygon(newPolygon *shapes.RegPolygon)

SetPolygon lol

type RectangleGenerator

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

RectangleGenerator generates a rectangle with the given start and end points

func NewRectangleGenerator

func NewRectangleGenerator(bounds shapes.Bounds) (r *RectangleGenerator)

NewRectangleGenerator returns a new RectangleGenerator instance

func (*RectangleGenerator) GenerateRectangle

func (r *RectangleGenerator) GenerateRectangle() *shapes.IrRegPolygon

GenerateRectangle generates a rectangle, lol

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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