relative

package
v0.0.0-...-e7ac65d Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LayoutTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "RelativeLayout"}

The XML name of the element

Functions

func NewLayout

func NewLayout(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element

Function to create a new relative layout

Types

type Layout

type Layout struct {
	// A relative layout is an
	// element
	element.Impl
	// contains filtered or unexported fields
}

Layout type for displaying elements relative to each other

func (*Layout) Draw

func (e *Layout) Draw()

Function to draw the element

func (*Layout) GetChild

func (e *Layout) GetChild(n int) element.Element

Function to get one of a layout's child elements

func (*Layout) GetChildByID

func (e *Layout) GetChildByID(id string) element.Element

Function to get one of a layout's child elements by its ID. Returns nil if no child could be found

func (*Layout) Init

func (e *Layout) Init(window *pixelgl.Window, bounds *pixel.Rect) error

Function to initialise the element

func (*Layout) IsInitialised

func (e *Layout) IsInitialised() bool

Function to determine whether the element is initialised

func (*Layout) NewEvent

func (e *Layout) NewEvent(window *pixelgl.Window)

Function that is called when there is a new event. This function only calls NewEvent on the child elements

func (*Layout) NumChildren

func (e *Layout) NumChildren() int

Function to get the number element elements a layout has

func (*Layout) Reset

func (e *Layout) Reset()

Function to reset the child elements

func (*Layout) ResetPosition

func (e *Layout) ResetPosition()

Function to reset the child element's positions

func (*Layout) UnmarshalXML

func (e *Layout) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal

Jump to

Keyboard shortcuts

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