builtin

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

The XML name of the import element

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

The XML name of the element

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

The XML name of the import element

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

The XML name of the import element

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

The XML name of the element

Functions

func NewFixedRatio

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

Function to create a new fixed ratio element

func NewImage

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

Function to create a new image

func NewImport

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

Function to create a new import element

func NewScroll

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

Function to create a new import element

func NewText

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

Function to create a new text

Types

type FixedRatio

type FixedRatio struct {
	// The fixed ratio element is an element
	element.Impl
	// It is also (technically) a layout
	element.LayoutImpl

	// The ratio itself
	Ratio util.Ratio `uixml:"http://github.com/bhollier/ui/api/schema ratio"`
}

Type for an element that enforces a fixed ratio on its child element

func (*FixedRatio) Draw

func (e *FixedRatio) Draw()

Function to draw the element

func (*FixedRatio) Init

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

Function to initialise an element's position, width and height. Because it doesn't know the element's actual size, it won't set the width or height if the relative width or height is "match_content"

func (*FixedRatio) IsInitialised

func (e *FixedRatio) IsInitialised() bool

Function to determine whether the element is initialised

func (*FixedRatio) NewEvent

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

Function that is called when there is a new event

func (*FixedRatio) Reset

func (e *FixedRatio) Reset()

Function to reset the element

func (*FixedRatio) ResetPosition

func (e *FixedRatio) ResetPosition()

Function to reset the element's position

func (*FixedRatio) UnmarshalXML

func (e *FixedRatio) 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

type Image

type Image struct {
	// An image element is an
	// element
	element.Impl

	// It also has an image
	element.ImageImpl
}

Element type for an image

func (*Image) Draw

func (e *Image) Draw()

Function to draw the element

func (*Image) Init

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

Function to initialise the element (load textures, create sprites, set sprite locations, etc.)

func (*Image) IsInitialised

func (e *Image) IsInitialised() bool

Function to determine whether the element is initialised

func (*Image) Reset

func (e *Image) Reset()

Function to reset the element

func (*Image) UnmarshalXML

func (e *Image) 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

type Import

type Import struct {
	// The import element is an element
	element.Impl
	// It is also (technically) a layout
	element.LayoutImpl

	// The path to the design
	Path string `uixml:"http://github.com/bhollier/ui/api/schema path"`
}

Type for an element that imports another design

func (*Import) Draw

func (e *Import) Draw()

Function to draw the element

func (*Import) Init

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

Function to initialise an element's position, width and height. Because it doesn't know the element's actual size, it won't set the width or height if the relative width or height is "match_content"

func (*Import) IsInitialised

func (e *Import) IsInitialised() bool

Function to determine whether the element is initialised

func (*Import) NewEvent

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

Function that is called when there is a new event

func (*Import) Reset

func (e *Import) Reset()

Function to reset the element

func (*Import) ResetPosition

func (e *Import) ResetPosition()

Function to reset the element's position

func (*Import) UnmarshalXML

func (e *Import) 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

type Scroll

type Scroll struct {
	// The scroll is an element
	element.Impl
	// It is also (technically) a layout
	element.LayoutImpl

	// The scroll rate
	ScrollRate uint `uixml:"http://github.com/bhollier/ui/api/schema scroll-speed,optional"`
	// contains filtered or unexported fields
}

Type for an element that scrolls

func (*Scroll) Draw

func (e *Scroll) Draw()

Function to draw the element

func (*Scroll) Init

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

Function to initialise an element's position, width and height. Because it doesn't know the element's actual size, it won't set the width or height if the relative width or height is "match_content"

func (*Scroll) IsInitialised

func (e *Scroll) IsInitialised() bool

Function to determine whether the element is initialised

func (*Scroll) NewEvent

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

Function that is called when there is a new event

func (*Scroll) Reset

func (e *Scroll) Reset()

Function to reset the element

func (*Scroll) ResetPosition

func (e *Scroll) ResetPosition()

Function to reset the element's position

func (*Scroll) UnmarshalXML

func (e *Scroll) 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

type Text

type Text struct {
	// A text element is an
	// element
	element.Impl

	// It also has text
	element.TextImpl
	// contains filtered or unexported fields
}

Element type for a text

func (*Text) Draw

func (e *Text) Draw()

Function to draw the element

func (*Text) Init

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

Function to initialise the element (load textures, create sprites, set sprite locations, etc.)

func (*Text) IsInitialised

func (e *Text) IsInitialised() bool

Function to determine whether the element is initialised

func (*Text) Reset

func (e *Text) Reset()

Function to reset the element

func (*Text) SetText

func (e *Text) SetText(s string) error

Function to set the text content

func (*Text) UnmarshalXML

func (e *Text) 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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