Documentation ¶
Index ¶
- Variables
- func NewFixedRatio(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- func NewImage(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- func NewImport(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- func NewScroll(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- func NewText(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element
- type FixedRatio
- func (e *FixedRatio) Draw()
- func (e *FixedRatio) Init(window *pixelgl.Window, bounds *pixel.Rect) (err error)
- func (e *FixedRatio) IsInitialised() bool
- func (e *FixedRatio) NewEvent(window *pixelgl.Window)
- func (e *FixedRatio) Reset()
- func (e *FixedRatio) ResetPosition()
- func (e *FixedRatio) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- type Image
- type Import
- func (e *Import) Draw()
- func (e *Import) Init(window *pixelgl.Window, bounds *pixel.Rect) (err error)
- func (e *Import) IsInitialised() bool
- func (e *Import) NewEvent(window *pixelgl.Window)
- func (e *Import) Reset()
- func (e *Import) ResetPosition()
- func (e *Import) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- type Scroll
- func (e *Scroll) Draw()
- func (e *Scroll) Init(window *pixelgl.Window, bounds *pixel.Rect) (err error)
- func (e *Scroll) IsInitialised() bool
- func (e *Scroll) NewEvent(window *pixelgl.Window)
- func (e *Scroll) Reset()
- func (e *Scroll) ResetPosition()
- func (e *Scroll) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)
- type Text
Constants ¶
This section is empty.
Variables ¶
var FixedRatioTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "FixedRatio"}
The XML name of the import element
var ImageTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "Image"}
The XML name of the element
var ImportTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "Import"}
The XML name of the import element
var ScrollTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "Scroll"}
The XML name of the import element
var TextTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "Text"}
The XML name of the element
Functions ¶
func NewFixedRatio ¶
Function to create a new fixed ratio element
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) Init ¶
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) 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) Init ¶
Function to initialise the element (load textures, create sprites, set sprite locations, etc.)
func (*Image) IsInitialised ¶
Function to determine whether the element is initialised
func (*Image) UnmarshalXML ¶
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) Init ¶
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 ¶
Function to determine whether the element is initialised
func (*Import) ResetPosition ¶
func (e *Import) ResetPosition()
Function to reset the element's position
func (*Import) UnmarshalXML ¶
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) Init ¶
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 ¶
Function to determine whether the element is initialised
func (*Scroll) ResetPosition ¶
func (e *Scroll) ResetPosition()
Function to reset the element's position
func (*Scroll) UnmarshalXML ¶
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) Init ¶
Function to initialise the element (load textures, create sprites, set sprite locations, etc.)
func (*Text) IsInitialised ¶
Function to determine whether the element is initialised
func (*Text) UnmarshalXML ¶
Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal