Fyne API "canvas.Polygon"

canvas.Polygon


import "fyne.io/fyne/v2/canvas"

Usage

type Polygon

type Polygon struct {
	FillColor    color.Color // The polygon fill color
	StrokeColor  color.Color // The polygon stroke color
	StrokeWidth  float32     // The stroke width of the polygon
	CornerRadius float32     // The radius of the polygon corners
	Angle        float32     // Angle of polygon, in degrees (positive means clockwise, negative means counter-clockwise direction).
	Sides        uint        //	Amount of sides of polygon.
}

Polygon describes a colored regular polygon primitive in a Fyne canvas. The rendered portion will be in the center of the available space.

Since: 2.7

func NewPolygon

func NewPolygon(sides uint, color color.Color) *Polygon

NewPolygon returns a new Polygon instance

func (*Polygon) Hide

func (r *Polygon) Hide()

Hide will set this polygon to not be visible

func (*Polygon) MinSize

func (o *Polygon) MinSize() fyne.Size

MinSize returns the specified minimum size, if set, or {1, 1} otherwise.

func (*Polygon) Move

func (r *Polygon) Move(pos fyne.Position)

Move the polygon to a new position, relative to its parent / canvas

func (*Polygon) Position

func (o *Polygon) Position() fyne.Position

Position gets the current position of this canvas object, relative to its parent.

func (*Polygon) Refresh

func (r *Polygon) Refresh()

Refresh causes this polygon to be redrawn with its configured state.

func (*Polygon) Resize

func (r *Polygon) Resize(s fyne.Size)

Resize on a polygon updates the new size of this object. If it has a stroke width this will cause it to Refresh.

func (*Polygon) SetMinSize

func (o *Polygon) SetMinSize(size fyne.Size)

SetMinSize specifies the smallest size this object should be.

func (*Polygon) Show

func (o *Polygon) Show()

Show will set this object to be visible.

func (*Polygon) Size

func (o *Polygon) Size() fyne.Size

Size returns the current size of this canvas object.

func (*Polygon) Visible

func (o *Polygon) Visible() bool

Visible returns true if this object is visible, false otherwise.