Edit me

fyne.Position


import "fyne.io/fyne/v2"

Usage

type Position

type Position struct {
	X float32 // The position from the parent's left edge
	Y float32 // The position from the parent's top edge
}

Position describes a generic X, Y coordinate relative to a parent Canvas or CanvasObject.

func NewPos

func NewPos(x float32, y float32) Position

NewPos returns a newly allocated Position representing the specified coordinates.

func (Position) Add

func (p Position) Add(v Vector2) Position

Add returns a new Position that is the result of offsetting the current position by p2 X and Y.

func (Position) Components

func (p Position) Components() (float32, float32)

Components returns the X and Y elements of this Position

func (Position) IsZero

func (p Position) IsZero() bool

IsZero returns whether the Position is at the zero-point.

func (Position) Subtract

func (p Position) Subtract(v Vector2) Position

Subtract returns a new Position that is the result of offsetting the current position by p2 -X and -Y.

Tags: