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

Usage

type ArbitraryPolygon

  type ArbitraryPolygon struct {
	Points           []fyne.Position // Vertices in coordinates relative to the object. If NormalizedPoints is true, these are (0.0 to 1.0), otherwise absolute
	NormalizedPoints bool            // True if Points are specified in normalized coordinates (0.0 to 1.0) relative to the object's size
	CornerRadii      []float32       // Per-corner rounding radius, must match len(Points), missing entries default to 0
	FillColor        color.Color     // The polygon fill color
	StrokeColor      color.Color     // The polygon stroke color
	StrokeWidth      float32         // The stroke width of the polygon
}
  

ArbitraryPolygon describes a colored arbitrary polygon primitive in a Fyne canvas. The polygon is defined by a list of vertex positions in clockwise order, relative to the object (top-left is (0,0), bottom-right is (width,height)). Each corner can have an individually specified rounding radius. The implementation is limited to 16 vertices.

Since: 2.8

func NewArbitraryPolygon

  func NewArbitraryPolygon(points []fyne.Position, fill color.Color) *ArbitraryPolygon
  

NewArbitraryPolygon returns a new ArbitraryPolygon instance

func (*ArbitraryPolygon) Hide

  func (p *ArbitraryPolygon) Hide()
  

Hide will set this arbitrary polygon to not be visible

func (*ArbitraryPolygon) MinSize

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

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

func (*ArbitraryPolygon) Move

  func (p *ArbitraryPolygon) Move(pos fyne.Position)
  

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

func (*ArbitraryPolygon) Position

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

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

func (*ArbitraryPolygon) Refresh

  func (p *ArbitraryPolygon) Refresh()
  

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

func (*ArbitraryPolygon) Resize

  func (p *ArbitraryPolygon) Resize(s fyne.Size)
  

Resize on an arbitrary polygon updates the new size of this object.

func (*ArbitraryPolygon) SetMinSize

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

SetMinSize specifies the smallest size this object should be.

func (*ArbitraryPolygon) Show

  func (o *ArbitraryPolygon) Show()
  

Show will set this object to be visible.

func (*ArbitraryPolygon) Size

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

Size returns the current size of this canvas object.

func (*ArbitraryPolygon) Visible

  func (o *ArbitraryPolygon) Visible() bool
  

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