Documentation ¶
Index ¶
- Variables
- func NewComponent(width, height int, options *ComponentOptions) *component
- func SetDefaultHorizontalPadding(padding int)
- func SetDefaultPadding(left, right, top, bottom int)
- func SetDefaultVerticalPadding(padding int)
- type Button
- func (b *Button) AddClickedHandler(f ButtonClickedHandlerFunc) *Button
- func (c *Button) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *Button) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *Button) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *Button) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (b *Button) AddPressedHandler(f ButtonPressedHandlerFunc) *Button
- func (b *Button) AddReleasedHandler(f ButtonReleasedHandlerFunc) *Button
- func (c *Button) Dimensions() (int, int)
- func (b *Button) Draw() *ebiten.Image
- func (c *Button) FireEvents()
- func (c *Button) Height() int
- func (c *Button) HeightWithPadding() int
- func (c *Button) PosX() float64
- func (c *Button) PosY() float64
- func (c *Button) Position() (float64, float64)
- func (c *Button) SetDimensions(width, height int)
- func (c *Button) SetDisabled(disabled bool)
- func (c *Button) SetHeight(height int)
- func (b *Button) SetLabel(label *Label)
- func (c *Button) SetPosX(posX float64)
- func (c *Button) SetPosY(posY float64)
- func (c *Button) SetPosision(posX, posY float64)
- func (c *Button) SetWidth(width int)
- func (c *Button) Width() int
- func (c *Button) WidthWithPadding() int
- type ButtonClickedEventArgs
- type ButtonClickedHandlerFunc
- type ButtonOptions
- type ButtonPressedEventArgs
- type ButtonPressedHandlerFunc
- type ButtonReleasedEventArgs
- type ButtonReleasedHandlerFunc
- type CheckBox
- func (c *CheckBox) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *CheckBox) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *CheckBox) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *CheckBox) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (cb *CheckBox) AddToggledHandler(f CheckBoxToggledHandlerFunc) *CheckBox
- func (c *CheckBox) Dimensions() (int, int)
- func (cb *CheckBox) Draw() *ebiten.Image
- func (c *CheckBox) FireEvents()
- func (c *CheckBox) Height() int
- func (c *CheckBox) HeightWithPadding() int
- func (c *CheckBox) PosX() float64
- func (c *CheckBox) PosY() float64
- func (c *CheckBox) Position() (float64, float64)
- func (cb *CheckBox) Set(checked bool)
- func (c *CheckBox) SetDimensions(width, height int)
- func (c *CheckBox) SetDisabled(disabled bool)
- func (c *CheckBox) SetHeight(height int)
- func (cb *CheckBox) SetLabel(label *Label)
- func (c *CheckBox) SetPosX(posX float64)
- func (c *CheckBox) SetPosY(posY float64)
- func (c *CheckBox) SetPosision(posX, posY float64)
- func (c *CheckBox) SetWidth(width int)
- func (cb *CheckBox) Toggle()
- func (c *CheckBox) Width() int
- func (c *CheckBox) WidthWithPadding() int
- type CheckBoxOptions
- type CheckBoxToggledEventArgs
- type CheckBoxToggledHandlerFunc
- type Component
- type ComponentCursorEnterEventArgs
- type ComponentCursorEnterHandlerFunc
- type ComponentCursorExitEventArgs
- type ComponentCursorExitHandlerFunc
- type ComponentMouseButtonPressedEventArgs
- type ComponentMouseButtonPressedHandlerFunc
- type ComponentMouseButtonReleasedEventArgs
- type ComponentMouseButtonReleasedHandlerFunc
- type ComponentOptions
- type Container
- type Direction
- type HorizontalAlignment
- type Label
- func (c *Label) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *Label) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *Label) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *Label) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (c *Label) Dimensions() (int, int)
- func (l *Label) Draw() *ebiten.Image
- func (c *Label) FireEvents()
- func (c *Label) Height() int
- func (c *Label) HeightWithPadding() int
- func (l *Label) InvertColor()
- func (c *Label) PosX() float64
- func (c *Label) PosY() float64
- func (c *Label) Position() (float64, float64)
- func (c *Label) SetDimensions(width, height int)
- func (c *Label) SetDisabled(disabled bool)
- func (c *Label) SetHeight(height int)
- func (l *Label) SetPosX(posX float64)
- func (l *Label) SetPosY(posY float64)
- func (c *Label) SetPosision(posX, posY float64)
- func (l *Label) SetPosistion(posX, posY float64)
- func (c *Label) SetWidth(width int)
- func (c *Label) Width() int
- func (c *Label) WidthWithPadding() int
- type LabelOptions
- type ListContainer
- func (c *ListContainer) AddComponent(component Component)
- func (c *ListContainer) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *ListContainer) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *ListContainer) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *ListContainer) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (c *ListContainer) Dimensions() (int, int)
- func (c *ListContainer) Draw() *ebiten.Image
- func (c *ListContainer) FireEvents()
- func (c *ListContainer) GetBackgroundColor() imgColor.RGBA
- func (c *ListContainer) Height() int
- func (c *ListContainer) HeightWithPadding() int
- func (c *ListContainer) PosX() float64
- func (c *ListContainer) PosY() float64
- func (c *ListContainer) Position() (float64, float64)
- func (c *ListContainer) SetBackgroundColor(color imgColor.RGBA)
- func (c *ListContainer) SetDimensions(width, height int)
- func (c *ListContainer) SetDisabled(disabled bool)
- func (c *ListContainer) SetHeight(height int)
- func (c *ListContainer) SetPosX(posX float64)
- func (c *ListContainer) SetPosY(posY float64)
- func (c *ListContainer) SetPosision(posX, posY float64)
- func (c *ListContainer) SetWidth(width int)
- func (c *ListContainer) Width() int
- func (c *ListContainer) WidthWithPadding() int
- type ListContainerOptions
- type SimpleContainer
- func (c *SimpleContainer) AddComponent(component Component)
- func (c *SimpleContainer) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *SimpleContainer) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *SimpleContainer) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *SimpleContainer) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (c *SimpleContainer) Dimensions() (int, int)
- func (c *SimpleContainer) Draw() *ebiten.Image
- func (c *SimpleContainer) FireEvents()
- func (c *SimpleContainer) GetBackgroundColor() imgColor.RGBA
- func (c *SimpleContainer) Height() int
- func (c *SimpleContainer) HeightWithPadding() int
- func (c *SimpleContainer) PosX() float64
- func (c *SimpleContainer) PosY() float64
- func (c *SimpleContainer) Position() (float64, float64)
- func (c *SimpleContainer) SetBackgroundColor(color imgColor.RGBA)
- func (c *SimpleContainer) SetDimensions(width, height int)
- func (c *SimpleContainer) SetDisabled(disabled bool)
- func (c *SimpleContainer) SetHeight(height int)
- func (c *SimpleContainer) SetPosX(posX float64)
- func (c *SimpleContainer) SetPosY(posY float64)
- func (c *SimpleContainer) SetPosision(posX, posY float64)
- func (c *SimpleContainer) SetWidth(width int)
- func (c *SimpleContainer) Width() int
- func (c *SimpleContainer) WidthWithPadding() int
- type SimpleContainerOptions
- type VerticalAlignment
Constants ¶
This section is empty.
Variables ¶
var ( DefaultLeftPadding = 0 DefaultRightPadding = 0 DefaultTopPadding = 0 DefaultBottomPadding = 0 )
Functions ¶
func NewComponent ¶
func NewComponent(width, height int, options *ComponentOptions) *component
NewComponent creates a new component.
func SetDefaultHorizontalPadding ¶ added in v0.4.0
func SetDefaultHorizontalPadding(padding int)
func SetDefaultPadding ¶ added in v0.4.0
func SetDefaultPadding(left, right, top, bottom int)
func SetDefaultVerticalPadding ¶ added in v0.4.0
func SetDefaultVerticalPadding(padding int)
Types ¶
type Button ¶
type Button struct { PressedEvent *event.Event ReleasedEvent *event.Event ClickedEvent *event.Event // contains filtered or unexported fields }
func NewButton ¶
func NewButton(options *ButtonOptions) *Button
func (*Button) AddClickedHandler ¶
func (b *Button) AddClickedHandler(f ButtonClickedHandlerFunc) *Button
func (*Button) AddCursorEnterHandler ¶ added in v0.4.0
func (c *Button) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*Button) AddCursorExitHandler ¶ added in v0.4.0
func (c *Button) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*Button) AddMouseButtonPressedHandler ¶ added in v0.4.0
func (c *Button) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*Button) AddMouseButtonReleasedHandler ¶ added in v0.4.0
func (c *Button) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*Button) AddPressedHandler ¶
func (b *Button) AddPressedHandler(f ButtonPressedHandlerFunc) *Button
func (*Button) AddReleasedHandler ¶
func (b *Button) AddReleasedHandler(f ButtonReleasedHandlerFunc) *Button
func (*Button) Dimensions ¶ added in v0.4.0
Dimensions returns the component's size (width and height).
func (*Button) FireEvents ¶
func (c *Button) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*Button) Height ¶ added in v0.4.0
func (c *Button) Height() int
Height returns the component's height.
func (*Button) HeightWithPadding ¶ added in v0.4.0
func (c *Button) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*Button) PosX ¶ added in v0.4.0
func (c *Button) PosX() float64
PosX returns the component's position X.
func (*Button) PosY ¶ added in v0.4.0
func (c *Button) PosY() float64
PosY returns the component's position Y.
func (*Button) SetDimensions ¶
func (c *Button) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*Button) SetDisabled ¶
func (c *Button) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*Button) SetHeight ¶
func (c *Button) SetHeight(height int)
SetHeight sets the component's height.
func (*Button) SetLabel ¶
SetLabel sets the label of the button and sets the dimensions of the button accordingly.
func (*Button) SetPosX ¶
func (c *Button) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*Button) SetPosY ¶
func (c *Button) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*Button) SetPosision ¶ added in v0.4.0
func (c *Button) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*Button) Width ¶ added in v0.4.0
func (c *Button) Width() int
Width returns the component's width.
func (*Button) WidthWithPadding ¶ added in v0.4.0
func (c *Button) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type ButtonClickedEventArgs ¶
type ButtonClickedEventArgs struct {
Button *Button
}
type ButtonClickedHandlerFunc ¶
type ButtonClickedHandlerFunc func(args *ButtonClickedEventArgs)
type ButtonOptions ¶
type ButtonPressedEventArgs ¶
type ButtonPressedEventArgs struct {
Button *Button
}
type ButtonPressedHandlerFunc ¶
type ButtonPressedHandlerFunc func(args *ButtonPressedEventArgs)
type ButtonReleasedEventArgs ¶
type ButtonReleasedHandlerFunc ¶
type ButtonReleasedHandlerFunc func(args *ButtonReleasedEventArgs)
type CheckBox ¶
type CheckBox struct { Checked bool ToggledEvent *event.Event // contains filtered or unexported fields }
func NewCheckBox ¶
func NewCheckBox(options *CheckBoxOptions) *CheckBox
func (*CheckBox) AddCursorEnterHandler ¶ added in v0.4.0
func (c *CheckBox) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*CheckBox) AddCursorExitHandler ¶ added in v0.4.0
func (c *CheckBox) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*CheckBox) AddMouseButtonPressedHandler ¶ added in v0.4.0
func (c *CheckBox) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*CheckBox) AddMouseButtonReleasedHandler ¶ added in v0.4.0
func (c *CheckBox) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*CheckBox) AddToggledHandler ¶
func (cb *CheckBox) AddToggledHandler(f CheckBoxToggledHandlerFunc) *CheckBox
func (*CheckBox) Dimensions ¶ added in v0.4.0
Dimensions returns the component's size (width and height).
func (*CheckBox) FireEvents ¶
func (c *CheckBox) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*CheckBox) Height ¶ added in v0.4.0
func (c *CheckBox) Height() int
Height returns the component's height.
func (*CheckBox) HeightWithPadding ¶ added in v0.4.0
func (c *CheckBox) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*CheckBox) PosX ¶ added in v0.4.0
func (c *CheckBox) PosX() float64
PosX returns the component's position X.
func (*CheckBox) PosY ¶ added in v0.4.0
func (c *CheckBox) PosY() float64
PosY returns the component's position Y.
func (*CheckBox) SetDimensions ¶
func (c *CheckBox) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*CheckBox) SetDisabled ¶
func (c *CheckBox) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*CheckBox) SetHeight ¶
func (c *CheckBox) SetHeight(height int)
SetHeight sets the component's height.
func (*CheckBox) SetLabel ¶
SetLabel sets the label of the checkbox and adjusts the checkbox's dimensions accordingly.
func (*CheckBox) SetPosX ¶
func (c *CheckBox) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*CheckBox) SetPosY ¶
func (c *CheckBox) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*CheckBox) SetPosision ¶ added in v0.4.0
func (c *CheckBox) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*CheckBox) SetWidth ¶
func (c *CheckBox) SetWidth(width int)
SetWidth sets the component's width.
func (*CheckBox) Width ¶ added in v0.4.0
func (c *CheckBox) Width() int
Width returns the component's width.
func (*CheckBox) WidthWithPadding ¶ added in v0.4.0
func (c *CheckBox) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type CheckBoxOptions ¶
type CheckBoxToggledEventArgs ¶
type CheckBoxToggledEventArgs struct {
CheckBox *CheckBox
}
type CheckBoxToggledHandlerFunc ¶
type CheckBoxToggledHandlerFunc func(args *CheckBoxToggledEventArgs)
type Component ¶
type Component interface { // Draw draws the component to it's image. Draw() *ebiten.Image // Dimensions returns the component's dimensions (width and height). Dimensions() (width int, height int) // Width returns the component's width. Width() int // WidthWithPadding returns the component's width with left and right paddings. WidthWithPadding() int // Height returns the component's height. Height() int // HeightWithPadding returns the component's height with top and bottom paddings. HeightWithPadding() int // Position returns the component's position. Position() (posX float64, posY float64) // PosX returns the component's position X. PosX() float64 // PosY returns the component's position Y. PosY() float64 // SetDisabled sets the component's disabled state. SetDisabled(disabled bool) // FireEvents fires the component's events. FireEvents() // SetWidth sets the component's width. SetWidth(width int) // SetHeight sets the component's height. SetHeight(height int) // SetDimensions sets the component's dimensions. SetDimensions(width, height int) // SetPosX sets the component's position X. SetPosX(posX float64) // SetPosY sets the component's position Y. SetPosY(posY float64) // SetPosision sets the component's position (x and y) SetPosision(posX, posY float64) // contains filtered or unexported methods }
Component is an abstraction of a user interface component, like a button or checkbox.
type ComponentCursorEnterEventArgs ¶
type ComponentCursorEnterEventArgs struct {
Component *component
}
ComponentCursorEnterEventArgs are the arguments for cursor enter events.
type ComponentCursorEnterHandlerFunc ¶
type ComponentCursorEnterHandlerFunc func(args *ComponentCursorEnterEventArgs) //nolint:golint
ComponentCursorEnterHandlerFunc is a function that handles cursor enter events.
type ComponentCursorExitEventArgs ¶
type ComponentCursorExitEventArgs struct {
Component *component
}
ComponentCursorExitEventArgs are the arguments for cursor exit events.
type ComponentCursorExitHandlerFunc ¶
type ComponentCursorExitHandlerFunc func(args *ComponentCursorExitEventArgs) //nolint:golint
ComponentCursorExitHandlerFunc is a function that handles cursor exit events.
type ComponentMouseButtonPressedEventArgs ¶
type ComponentMouseButtonPressedEventArgs struct { Component *component Button ebiten.MouseButton }
ComponentMouseButtonPressedEventArgs are the arguments for mouse button press events.
type ComponentMouseButtonPressedHandlerFunc ¶
type ComponentMouseButtonPressedHandlerFunc func(args *ComponentMouseButtonPressedEventArgs) //nolint:golint
ComponentMouseButtonPressedHandlerFunc is a function that handles mouse button press events.
type ComponentMouseButtonReleasedEventArgs ¶
type ComponentMouseButtonReleasedEventArgs struct { Component *component Button ebiten.MouseButton Inside bool }
ComponentMouseButtonReleasedEventArgs are the arguments for mouse button release events.
type ComponentMouseButtonReleasedHandlerFunc ¶
type ComponentMouseButtonReleasedHandlerFunc func(args *ComponentMouseButtonReleasedEventArgs) //nolint:golint
ComponentMouseButtonReleasedHandlerFunc is a function that handles mouse button release events.
type ComponentOptions ¶
type ComponentOptions struct { LeftPadding *int RightPadding *int TopPadding *int BottomPadding *int }
ComponentOptions is a struct that holds component options.
type HorizontalAlignment ¶
type HorizontalAlignment int
const ( AlignmentLeft HorizontalAlignment = iota AlignmentCenteredHorizontally AlignmentRight )
type Label ¶
type Label struct { Inverted bool // contains filtered or unexported fields }
func NewLabel ¶
func NewLabel(labelText string, options *LabelOptions) *Label
func (*Label) AddCursorEnterHandler ¶ added in v0.4.0
func (c *Label) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*Label) AddCursorExitHandler ¶ added in v0.4.0
func (c *Label) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*Label) AddMouseButtonPressedHandler ¶ added in v0.4.0
func (c *Label) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*Label) AddMouseButtonReleasedHandler ¶ added in v0.4.0
func (c *Label) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*Label) Dimensions ¶ added in v0.4.0
Dimensions returns the component's size (width and height).
func (*Label) FireEvents ¶
func (c *Label) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*Label) Height ¶ added in v0.4.0
func (c *Label) Height() int
Height returns the component's height.
func (*Label) HeightWithPadding ¶ added in v0.4.0
func (c *Label) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*Label) InvertColor ¶
func (l *Label) InvertColor()
func (*Label) PosX ¶ added in v0.4.0
func (c *Label) PosX() float64
PosX returns the component's position X.
func (*Label) PosY ¶ added in v0.4.0
func (c *Label) PosY() float64
PosY returns the component's position Y.
func (*Label) SetDimensions ¶
func (c *Label) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*Label) SetDisabled ¶
func (c *Label) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*Label) SetHeight ¶
func (c *Label) SetHeight(height int)
SetHeight sets the component's height.
func (*Label) SetPosision ¶ added in v0.4.0
func (c *Label) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*Label) SetPosistion ¶
func (*Label) Width ¶ added in v0.4.0
func (c *Label) Width() int
Width returns the component's width.
func (*Label) WidthWithPadding ¶ added in v0.4.0
func (c *Label) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type LabelOptions ¶
type ListContainer ¶ added in v0.4.0
type ListContainer struct {
// contains filtered or unexported fields
}
ListContainer is a component that contains other components
func NewListContainer ¶ added in v0.4.0
func NewListContainer(options *ListContainerOptions) *ListContainer
NewListContainer creates a new List container
func (*ListContainer) AddComponent ¶ added in v0.4.0
func (c *ListContainer) AddComponent(component Component)
AddComponent adds a component to the container
func (*ListContainer) AddCursorEnterHandler ¶ added in v0.4.0
func (c *ListContainer) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*ListContainer) AddCursorExitHandler ¶ added in v0.4.0
func (c *ListContainer) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*ListContainer) AddMouseButtonPressedHandler ¶ added in v0.4.0
func (c *ListContainer) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*ListContainer) AddMouseButtonReleasedHandler ¶ added in v0.4.0
func (c *ListContainer) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*ListContainer) Dimensions ¶ added in v0.4.0
Dimensions returns the component's size (width and height).
func (*ListContainer) Draw ¶ added in v0.4.0
func (c *ListContainer) Draw() *ebiten.Image
Draw draws the container's components, executes deferred events and returns the image.
func (*ListContainer) FireEvents ¶ added in v0.4.0
func (c *ListContainer) FireEvents()
FireEvents fires the container's components deferred events
func (*ListContainer) GetBackgroundColor ¶ added in v0.4.0
func (c *ListContainer) GetBackgroundColor() imgColor.RGBA
func (*ListContainer) Height ¶ added in v0.4.0
func (c *ListContainer) Height() int
Height returns the component's height.
func (*ListContainer) HeightWithPadding ¶ added in v0.4.0
func (c *ListContainer) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*ListContainer) PosX ¶ added in v0.4.0
func (c *ListContainer) PosX() float64
PosX returns the component's position X.
func (*ListContainer) PosY ¶ added in v0.4.0
func (c *ListContainer) PosY() float64
PosY returns the component's position Y.
func (*ListContainer) Position ¶ added in v0.4.0
Position returns the component's position (x and y).
func (*ListContainer) SetBackgroundColor ¶ added in v0.4.0
func (c *ListContainer) SetBackgroundColor(color imgColor.RGBA)
func (*ListContainer) SetDimensions ¶ added in v0.4.0
func (c *ListContainer) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*ListContainer) SetDisabled ¶ added in v0.4.0
func (c *ListContainer) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*ListContainer) SetHeight ¶ added in v0.4.0
func (c *ListContainer) SetHeight(height int)
SetHeight sets the component's height.
func (*ListContainer) SetPosX ¶ added in v0.4.0
func (c *ListContainer) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*ListContainer) SetPosY ¶ added in v0.4.0
func (c *ListContainer) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*ListContainer) SetPosision ¶ added in v0.4.0
func (c *ListContainer) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*ListContainer) SetWidth ¶ added in v0.4.0
func (c *ListContainer) SetWidth(width int)
SetWidth sets the component's width.
func (*ListContainer) Width ¶ added in v0.4.0
func (c *ListContainer) Width() int
Width returns the component's width.
func (*ListContainer) WidthWithPadding ¶ added in v0.4.0
func (c *ListContainer) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type ListContainerOptions ¶ added in v0.4.0
type SimpleContainer ¶
type SimpleContainer struct {
// contains filtered or unexported fields
}
SimpleContainer is a component that contains other components
func NewSimpleContainer ¶
func NewSimpleContainer(width, height int, options *SimpleContainerOptions) *SimpleContainer
NewSimpleContainer creates a new simple container
func (*SimpleContainer) AddComponent ¶
func (c *SimpleContainer) AddComponent(component Component)
AddComponent adds a component to the container
func (*SimpleContainer) AddCursorEnterHandler ¶ added in v0.4.0
func (c *SimpleContainer) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*SimpleContainer) AddCursorExitHandler ¶ added in v0.4.0
func (c *SimpleContainer) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*SimpleContainer) AddMouseButtonPressedHandler ¶ added in v0.4.0
func (c *SimpleContainer) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*SimpleContainer) AddMouseButtonReleasedHandler ¶ added in v0.4.0
func (c *SimpleContainer) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*SimpleContainer) Dimensions ¶ added in v0.4.0
Dimensions returns the component's size (width and height).
func (*SimpleContainer) Draw ¶
func (c *SimpleContainer) Draw() *ebiten.Image
Draw draws the container's components, executes deferred events and returns the image.
func (*SimpleContainer) FireEvents ¶
func (c *SimpleContainer) FireEvents()
FireEvents fires the container's components deferred events
func (*SimpleContainer) GetBackgroundColor ¶
func (c *SimpleContainer) GetBackgroundColor() imgColor.RGBA
func (*SimpleContainer) Height ¶ added in v0.4.0
func (c *SimpleContainer) Height() int
Height returns the component's height.
func (*SimpleContainer) HeightWithPadding ¶ added in v0.4.0
func (c *SimpleContainer) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*SimpleContainer) PosX ¶ added in v0.4.0
func (c *SimpleContainer) PosX() float64
PosX returns the component's position X.
func (*SimpleContainer) PosY ¶ added in v0.4.0
func (c *SimpleContainer) PosY() float64
PosY returns the component's position Y.
func (*SimpleContainer) SetBackgroundColor ¶
func (c *SimpleContainer) SetBackgroundColor(color imgColor.RGBA)
func (*SimpleContainer) SetDimensions ¶
func (c *SimpleContainer) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*SimpleContainer) SetDisabled ¶
func (c *SimpleContainer) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*SimpleContainer) SetHeight ¶
func (c *SimpleContainer) SetHeight(height int)
SetHeight sets the component's height.
func (*SimpleContainer) SetPosX ¶
func (c *SimpleContainer) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*SimpleContainer) SetPosY ¶
func (c *SimpleContainer) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*SimpleContainer) SetPosision ¶ added in v0.4.0
func (c *SimpleContainer) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*SimpleContainer) SetWidth ¶
func (c *SimpleContainer) SetWidth(width int)
SetWidth sets the component's width.
func (*SimpleContainer) Width ¶ added in v0.4.0
func (c *SimpleContainer) Width() int
Width returns the component's width.
func (*SimpleContainer) WidthWithPadding ¶ added in v0.4.0
func (c *SimpleContainer) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type SimpleContainerOptions ¶ added in v0.4.0
type VerticalAlignment ¶
type VerticalAlignment int
const ( AlignmentTop VerticalAlignment = iota AlignmentCenteredVertically AlignmentBottom )