Documentation ¶
Index ¶
- Variables
- func RegisterComponent(name string, comp func() Component)
- type Axis
- type BaseComponent
- func (bc *BaseComponent) Height() int
- func (bc *BaseComponent) Init()
- func (bc *BaseComponent) PrevImg() image.Image
- func (bc *BaseComponent) SetParentSize(width int, height int)
- func (bc *BaseComponent) SetPrevImg(img image.Image)
- func (bc *BaseComponent) Size() image.Point
- func (bc *BaseComponent) Stop()
- func (bc *BaseComponent) TickerChan() <-chan time.Time
- func (bc *BaseComponent) Width() int
- type Component
- type ComponentContext
- type Template
Constants ¶
This section is empty.
Variables ¶
View Source
var (
RegisteredComponents = map[string]func() Component{}
)
Functions ¶
func RegisterComponent ¶
Types ¶
type BaseComponent ¶
type BaseComponent struct { SizeX string `xml:"size-x,attr"` SizeY string `xml:"size-y,attr"` ComputedSizeX int ComputedSizeY int ParentWidth int ParentHeight int PosX int `xml:"pos-x,attr"` PosY int `xml:"pos-y,attr"` Ctx *gg.Context Ticker *time.Ticker Rr int // render rate in milliseconds // contains filtered or unexported fields }
func (*BaseComponent) Height ¶
func (bc *BaseComponent) Height() int
func (*BaseComponent) Init ¶
func (bc *BaseComponent) Init()
func (*BaseComponent) PrevImg ¶
func (bc *BaseComponent) PrevImg() image.Image
func (*BaseComponent) SetParentSize ¶
func (bc *BaseComponent) SetParentSize(width int, height int)
func (*BaseComponent) SetPrevImg ¶
func (bc *BaseComponent) SetPrevImg(img image.Image)
func (*BaseComponent) Size ¶
func (bc *BaseComponent) Size() image.Point
func (*BaseComponent) Stop ¶
func (bc *BaseComponent) Stop()
func (*BaseComponent) TickerChan ¶
func (bc *BaseComponent) TickerChan() <-chan time.Time
func (*BaseComponent) Width ¶
func (bc *BaseComponent) Width() int
type Component ¶
type Component interface { Init() // Ran before componenet is rendered Render() image.Image // Render the component to an image.Image representation Width() int // Return the width of the component. Used to help position components on the display Height() int // Return the height of the compoent. Used to help position components on the display PrevImg() image.Image // return the previously rendered image SetPrevImg(img image.Image) // the the previously rendered iamge TickerChan() <-chan time.Time // return the channel for the ticker Stop() // Stop the ticker SetParentSize(width int, height int) // set the parent's size to use in calculations }
type ComponentContext ¶
type ComponentContext struct {
CacheDir string
}
Click to show internal directories.
Click to hide internal directories.