Documentation ¶
Index ¶
- func SetDefaultHorizontalPadding(padding int)
- func SetDefaultPadding(left, right, top, bottom int)
- func SetDefaultVerticalPadding(padding int)
- type Button
- func (c *Button) AbsPosX() float64
- func (c *Button) AbsPosY() float64
- func (c *Button) AbsPosition() (posX float64, posY float64)
- 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 (c *Button) Disable() bool
- func (b *Button) Draw() *ebiten.Image
- func (c *Button) FireEvents()
- func (c *Button) Height() int
- func (c *Button) HeightWithPadding() int
- func (c *Button) Hidden() bool
- 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 (c *Button) SetHidden(hidden bool)
- 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 ButtonDrawer
- type ButtonOptions
- type ButtonPressedEventArgs
- type ButtonPressedHandlerFunc
- type ButtonReleasedEventArgs
- type ButtonReleasedHandlerFunc
- type CheckBox
- func (c *CheckBox) AbsPosX() float64
- func (c *CheckBox) AbsPosY() float64
- func (c *CheckBox) AbsPosition() (posX float64, posY float64)
- 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 (c *CheckBox) Disable() bool
- func (cb *CheckBox) Draw() *ebiten.Image
- func (c *CheckBox) FireEvents()
- func (c *CheckBox) Height() int
- func (c *CheckBox) HeightWithPadding() int
- func (c *CheckBox) Hidden() bool
- 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 (c *CheckBox) SetHidden(hidden bool)
- 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 CheckBoxDrawer
- 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 ContainerOptions
- type DefaultButtonDrawer
- type DefaultCheckBoxDrawer
- type DefaultSliderDrawer
- type GridLayout
- type HorizontalAlignment
- type HorizontalListLayout
- type Label
- func (c *Label) AbsPosX() float64
- func (c *Label) AbsPosY() float64
- func (c *Label) AbsPosition() (posX float64, posY float64)
- 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 (c *Label) Disable() bool
- func (l *Label) Draw() *ebiten.Image
- func (c *Label) FireEvents()
- func (c *Label) Height() int
- func (c *Label) HeightWithPadding() int
- func (c *Label) Hidden() bool
- 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 (c *Label) SetHidden(hidden bool)
- 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 (l *Label) SetText(labelText string)
- func (c *Label) SetWidth(width int)
- func (c *Label) Width() int
- func (c *Label) WidthWithPadding() int
- type LabelOptions
- type Layout
- type Padding
- type Slider
- func (c *Slider) AbsPosX() float64
- func (c *Slider) AbsPosY() float64
- func (c *Slider) AbsPosition() (posX float64, posY float64)
- func (s *Slider) AddComponent(Component)
- func (c *Slider) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *Slider) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *Slider) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *Slider) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (s *Slider) AddSlidedHandler(f SliderSlidedHandlerFunc) *Slider
- func (c *Slider) Dimensions() (int, int)
- func (c *Slider) Disable() bool
- func (s *Slider) Draw() *ebiten.Image
- func (s *Slider) FireEvents()
- func (s *Slider) GetBackgroundColor() color.RGBA
- func (s *Slider) GetValue() float64
- func (c *Slider) Height() int
- func (c *Slider) HeightWithPadding() int
- func (c *Slider) Hidden() bool
- func (c *Slider) PosX() float64
- func (c *Slider) PosY() float64
- func (c *Slider) Position() (float64, float64)
- func (s *Slider) Set(value float64)
- func (s *Slider) SetBackgroundColor(color color.RGBA)
- func (c *Slider) SetDimensions(width, height int)
- func (s *Slider) SetDisabled(disabled bool)
- func (c *Slider) SetHeight(height int)
- func (c *Slider) SetHidden(hidden bool)
- func (c *Slider) SetPosX(posX float64)
- func (c *Slider) SetPosY(posY float64)
- func (s *Slider) SetPosision(posX, posY float64)
- func (c *Slider) SetWidth(width int)
- func (c *Slider) Width() int
- func (c *Slider) WidthWithPadding() int
- type SliderClickedEventArgs
- type SliderClickedHandlerFunc
- type SliderDrawer
- type SliderOptions
- type SliderPressedEventArgs
- type SliderPressedHandlerFunc
- type SliderReleasedEventArgs
- type SliderReleasedHandlerFunc
- type SliderSlidedEventArgs
- type SliderSlidedHandlerFunc
- type Sprite
- func (c *Sprite) AbsPosX() float64
- func (c *Sprite) AbsPosY() float64
- func (c *Sprite) AbsPosition() (posX float64, posY float64)
- func (c *Sprite) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
- func (c *Sprite) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
- func (c *Sprite) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
- func (c *Sprite) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
- func (c *Sprite) Dimensions() (int, int)
- func (c *Sprite) Disable() bool
- func (s *Sprite) Draw() *ebiten.Image
- func (c *Sprite) FireEvents()
- func (c *Sprite) Height() int
- func (c *Sprite) HeightWithPadding() int
- func (c *Sprite) Hidden() bool
- func (c *Sprite) PosX() float64
- func (c *Sprite) PosY() float64
- func (c *Sprite) Position() (float64, float64)
- func (c *Sprite) SetDimensions(width, height int)
- func (c *Sprite) SetDisabled(disabled bool)
- func (c *Sprite) SetHeight(height int)
- func (c *Sprite) SetHidden(hidden bool)
- func (s *Sprite) SetImage(image *ebiten.Image)
- func (c *Sprite) SetPosX(posX float64)
- func (c *Sprite) SetPosY(posY float64)
- func (c *Sprite) SetPosision(posX, posY float64)
- func (c *Sprite) SetWidth(width int)
- func (c *Sprite) Width() int
- func (c *Sprite) WidthWithPadding() int
- type SpriteOptions
- type VerticalAlignment
- type VerticalListLayout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) AbsPosX ¶ added in v0.5.0
func (c *Button) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*Button) AbsPosY ¶ added in v0.5.0
func (c *Button) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*Button) AbsPosition ¶ added in v0.5.0
AbsPosition return the component's absolute position.
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) Disable ¶ added in v0.5.0
func (c *Button) Disable() bool
Disable returns the component's disabled state.
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) Hidden ¶ added in v0.5.0
func (c *Button) Hidden() bool
Hidden returns the component's hidden state.
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) SetHidden ¶ added in v0.5.0
func (c *Button) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
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 ButtonDrawer ¶ added in v0.6.0
type ButtonOptions ¶
type ButtonOptions struct { Width *int Height *int Drawer ButtonDrawer Label *Label Padding *Padding }
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) AbsPosX ¶ added in v0.5.0
func (c *CheckBox) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*CheckBox) AbsPosY ¶ added in v0.5.0
func (c *CheckBox) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*CheckBox) AbsPosition ¶ added in v0.5.0
AbsPosition return the component's absolute position.
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) Disable ¶ added in v0.5.0
func (c *CheckBox) Disable() bool
Disable returns the component's disabled state.
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) Hidden ¶ added in v0.5.0
func (c *CheckBox) Hidden() bool
Hidden returns the component's hidden state.
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) SetHidden ¶ added in v0.5.0
func (c *CheckBox) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
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 CheckBoxDrawer ¶ added in v0.6.0
type CheckBoxOptions ¶
type CheckBoxOptions struct { Label *Label Padding *Padding Drawer CheckBoxDrawer }
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 // AbsPosition return the component's absolute position. AbsPosition() (posX float64, posY float64) // AbsPosX returns the component's absolute position X. AbsPosX() float64 // AbsPosY returns the component's absolute position Y. AbsPosY() float64 // Disable returns the component's disabled state. Disable() bool // SetDisabled sets the component's disabled state. SetDisabled(disabled bool) // Hidden returns the component's hidden state. Hidden() bool // SetHidden sets the component's hidden state. SetHidden(hidden 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 ¶
ComponentOptions is a struct that holds component options.
type Container ¶
type Container interface { Component AddComponent(Component) SetBackgroundColor(imgColor.RGBA) GetBackgroundColor() imgColor.RGBA }
func NewContainer ¶ added in v0.5.0
func NewContainer(options *ContainerOptions) Container
Newcontainer creates a new simple container
type ContainerOptions ¶ added in v0.5.0
type DefaultButtonDrawer ¶ added in v0.6.0
type DefaultCheckBoxDrawer ¶ added in v0.6.0
type DefaultSliderDrawer ¶ added in v0.6.0
type GridLayout ¶ added in v0.5.0
type GridLayout struct { Columns int ColumnsWidths []int ColumnGap int Rows int RowsHeights []int RowGap int // contains filtered or unexported fields }
func (*GridLayout) Arrange ¶ added in v0.5.0
func (gl *GridLayout) Arrange(c *container, component Component)
func (*GridLayout) Rearrange ¶ added in v0.5.0
func (gl *GridLayout) Rearrange(c *container)
func (*GridLayout) Setup ¶ added in v0.5.0
func (gl *GridLayout) Setup()
type HorizontalAlignment ¶
type HorizontalAlignment int
const ( AlignmentLeft HorizontalAlignment = iota AlignmentCenteredHorizontally AlignmentRight )
type HorizontalListLayout ¶ added in v0.5.0
type HorizontalListLayout struct {
ColumnGap int
}
func (*HorizontalListLayout) Arrange ¶ added in v0.5.0
func (hl *HorizontalListLayout) Arrange(c *container, component Component)
func (*HorizontalListLayout) Rearrange ¶ added in v0.5.0
func (hl *HorizontalListLayout) Rearrange(c *container)
type Label ¶
type Label struct { Inverted bool // contains filtered or unexported fields }
func NewLabel ¶
func NewLabel(labelText string, options *LabelOptions) *Label
func (*Label) AbsPosX ¶ added in v0.5.0
func (c *Label) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*Label) AbsPosY ¶ added in v0.5.0
func (c *Label) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*Label) AbsPosition ¶ added in v0.5.0
AbsPosition return the component's absolute position.
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) Disable ¶ added in v0.5.0
func (c *Label) Disable() bool
Disable returns the component's disabled state.
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) Hidden ¶ added in v0.5.0
func (c *Label) Hidden() bool
Hidden returns the component's hidden state.
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) SetHidden ¶ added in v0.5.0
func (c *Label) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
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 LabelOptions struct { Color color.Color Font font.Face HorizontalAlignment HorizontalAlignment VerticalAlignment VerticalAlignment Inverted bool Padding *Padding }
type Layout ¶ added in v0.5.0
type Layout interface { Rearrange(*container) Arrange(*container, Component) }
type Padding ¶ added in v0.5.0
func NewPadding ¶ added in v0.5.0
type Slider ¶ added in v0.5.0
type Slider struct { SlidedEvent *event.Event PressedEvent *event.Event ReleasedEvent *event.Event ClickedEvent *event.Event // contains filtered or unexported fields }
func NewSlider ¶ added in v0.5.0
func NewSlider(options *SliderOptions) *Slider
func (*Slider) AbsPosX ¶ added in v0.5.0
func (c *Slider) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*Slider) AbsPosY ¶ added in v0.5.0
func (c *Slider) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*Slider) AbsPosition ¶ added in v0.5.0
AbsPosition return the component's absolute position.
func (*Slider) AddComponent ¶ added in v0.5.0
func (*Slider) AddCursorEnterHandler ¶ added in v0.5.0
func (c *Slider) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*Slider) AddCursorExitHandler ¶ added in v0.5.0
func (c *Slider) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*Slider) AddMouseButtonPressedHandler ¶ added in v0.5.0
func (c *Slider) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*Slider) AddMouseButtonReleasedHandler ¶ added in v0.5.0
func (c *Slider) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*Slider) AddSlidedHandler ¶ added in v0.5.0
func (s *Slider) AddSlidedHandler(f SliderSlidedHandlerFunc) *Slider
func (*Slider) Dimensions ¶ added in v0.5.0
Dimensions returns the component's size (width and height).
func (*Slider) Disable ¶ added in v0.5.0
func (c *Slider) Disable() bool
Disable returns the component's disabled state.
func (*Slider) FireEvents ¶ added in v0.5.0
func (s *Slider) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*Slider) GetBackgroundColor ¶ added in v0.5.0
func (*Slider) Height ¶ added in v0.5.0
func (c *Slider) Height() int
Height returns the component's height.
func (*Slider) HeightWithPadding ¶ added in v0.5.0
func (c *Slider) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*Slider) Hidden ¶ added in v0.5.0
func (c *Slider) Hidden() bool
Hidden returns the component's hidden state.
func (*Slider) PosX ¶ added in v0.5.0
func (c *Slider) PosX() float64
PosX returns the component's position X.
func (*Slider) PosY ¶ added in v0.5.0
func (c *Slider) PosY() float64
PosY returns the component's position Y.
func (*Slider) SetBackgroundColor ¶ added in v0.5.0
func (*Slider) SetDimensions ¶ added in v0.5.0
func (c *Slider) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*Slider) SetDisabled ¶ added in v0.5.0
func (*Slider) SetHeight ¶ added in v0.5.0
func (c *Slider) SetHeight(height int)
SetHeight sets the component's height.
func (*Slider) SetHidden ¶ added in v0.5.0
func (c *Slider) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
func (*Slider) SetPosX ¶ added in v0.5.0
func (c *Slider) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*Slider) SetPosY ¶ added in v0.5.0
func (c *Slider) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*Slider) SetPosision ¶ added in v0.5.0
func (*Slider) SetWidth ¶ added in v0.5.0
func (c *Slider) SetWidth(width int)
SetWidth sets the component's width.
func (*Slider) Width ¶ added in v0.5.0
func (c *Slider) Width() int
Width returns the component's width.
func (*Slider) WidthWithPadding ¶ added in v0.5.0
func (c *Slider) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type SliderClickedEventArgs ¶ added in v0.5.0
type SliderClickedEventArgs struct {
Slider *Slider
}
type SliderClickedHandlerFunc ¶ added in v0.5.0
type SliderClickedHandlerFunc func(args *SliderClickedEventArgs)
type SliderDrawer ¶ added in v0.6.0
type SliderOptions ¶ added in v0.5.0
type SliderOptions struct { Min *float64 Max *float64 Step *float64 DefaultValue *float64 Width *int Height *int Padding *Padding Drawer SliderDrawer HandleDrawer ButtonDrawer }
type SliderPressedEventArgs ¶ added in v0.5.0
type SliderPressedEventArgs struct {
Slider *Slider
}
type SliderPressedHandlerFunc ¶ added in v0.5.0
type SliderPressedHandlerFunc func(args *SliderPressedEventArgs)
type SliderReleasedEventArgs ¶ added in v0.5.0
type SliderReleasedHandlerFunc ¶ added in v0.5.0
type SliderReleasedHandlerFunc func(args *SliderReleasedEventArgs)
type SliderSlidedEventArgs ¶ added in v0.5.0
type SliderSlidedHandlerFunc ¶ added in v0.5.0
type SliderSlidedHandlerFunc func(args *SliderSlidedEventArgs)
type Sprite ¶ added in v0.6.0
type Sprite struct {
// contains filtered or unexported fields
}
func NewSprite ¶ added in v0.6.0
func NewSprite(image *ebiten.Image, options *SpriteOptions) *Sprite
func (*Sprite) AbsPosX ¶ added in v0.6.0
func (c *Sprite) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*Sprite) AbsPosY ¶ added in v0.6.0
func (c *Sprite) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*Sprite) AbsPosition ¶ added in v0.6.0
AbsPosition return the component's absolute position.
func (*Sprite) AddCursorEnterHandler ¶ added in v0.6.0
func (c *Sprite) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) *component
func (*Sprite) AddCursorExitHandler ¶ added in v0.6.0
func (c *Sprite) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) *component
func (*Sprite) AddMouseButtonPressedHandler ¶ added in v0.6.0
func (c *Sprite) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) *component
func (*Sprite) AddMouseButtonReleasedHandler ¶ added in v0.6.0
func (c *Sprite) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) *component
func (*Sprite) Dimensions ¶ added in v0.6.0
Dimensions returns the component's size (width and height).
func (*Sprite) Disable ¶ added in v0.6.0
func (c *Sprite) Disable() bool
Disable returns the component's disabled state.
func (*Sprite) FireEvents ¶ added in v0.6.0
func (c *Sprite) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*Sprite) Height ¶ added in v0.6.0
func (c *Sprite) Height() int
Height returns the component's height.
func (*Sprite) HeightWithPadding ¶ added in v0.6.0
func (c *Sprite) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*Sprite) Hidden ¶ added in v0.6.0
func (c *Sprite) Hidden() bool
Hidden returns the component's hidden state.
func (*Sprite) PosX ¶ added in v0.6.0
func (c *Sprite) PosX() float64
PosX returns the component's position X.
func (*Sprite) PosY ¶ added in v0.6.0
func (c *Sprite) PosY() float64
PosY returns the component's position Y.
func (*Sprite) SetDimensions ¶ added in v0.6.0
func (c *Sprite) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*Sprite) SetDisabled ¶ added in v0.6.0
func (c *Sprite) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*Sprite) SetHeight ¶ added in v0.6.0
func (c *Sprite) SetHeight(height int)
SetHeight sets the component's height.
func (*Sprite) SetHidden ¶ added in v0.6.0
func (c *Sprite) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
func (*Sprite) SetPosX ¶ added in v0.6.0
func (c *Sprite) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*Sprite) SetPosY ¶ added in v0.6.0
func (c *Sprite) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*Sprite) SetPosision ¶ added in v0.6.0
func (c *Sprite) SetPosision(posX, posY float64)
SetPosision sets the component's position (x and y).
func (*Sprite) SetWidth ¶ added in v0.6.0
func (c *Sprite) SetWidth(width int)
SetWidth sets the component's width.
func (*Sprite) Width ¶ added in v0.6.0
func (c *Sprite) Width() int
Width returns the component's width.
func (*Sprite) WidthWithPadding ¶ added in v0.6.0
func (c *Sprite) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type SpriteOptions ¶ added in v0.6.0
type SpriteOptions struct {
Padding *Padding
}
type VerticalAlignment ¶
type VerticalAlignment int
const ( AlignmentTop VerticalAlignment = iota AlignmentCenteredVertically AlignmentBottom )
type VerticalListLayout ¶ added in v0.5.0
type VerticalListLayout struct {
RowGap int
}
func (*VerticalListLayout) Arrange ¶ added in v0.5.0
func (vl *VerticalListLayout) Arrange(c *container, component Component)
func (*VerticalListLayout) Rearrange ¶ added in v0.5.0
func (vl *VerticalListLayout) Rearrange(c *container)