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) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *Button) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager() *event.Manager
- func (c *Button) FireEvents()
- func (c *Button) Focused() bool
- 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) SetEventManager(eventManager *event.Manager)
- func (c *Button) SetFocused(focused bool)
- func (c *Button) SetHeight(height int)
- func (c *Button) SetHidden(hidden bool)
- func (b *Button) SetLabel(label *Label)
- func (c *Button) SetPadding(padding Padding)
- func (c *Button) SetPaddingBottom(padding int)
- func (c *Button) SetPaddingLeft(padding int)
- func (c *Button) SetPaddingRight(padding int)
- func (c *Button) SetPaddingTop(padding int)
- func (c *Button) SetPosX(posX float64)
- func (c *Button) SetPosY(posY float64)
- func (c *Button) SetPosition(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) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *CheckBox) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) Component
- func (c *CheckBox) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) Component
- func (c *CheckBox) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) Component
- func (cb *CheckBox) AddToggledHandler(f CheckBoxToggledHandlerFunc) *CheckBox
- func (cb *CheckBox) Checked() bool
- func (c *CheckBox) Dimensions() (int, int)
- func (c *CheckBox) Disable() bool
- func (cb *CheckBox) Draw() *ebiten.Image
- func (c *CheckBox) EventManager() *event.Manager
- func (c *CheckBox) FireEvents()
- func (c *CheckBox) Focused() bool
- 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) SetEventManager(eventManager *event.Manager)
- func (c *CheckBox) SetFocused(focused bool)
- func (c *CheckBox) SetHeight(height int)
- func (c *CheckBox) SetHidden(hidden bool)
- func (cb *CheckBox) SetLabel(label *Label)
- func (c *CheckBox) SetPadding(padding Padding)
- func (c *CheckBox) SetPaddingBottom(padding int)
- func (c *CheckBox) SetPaddingLeft(padding int)
- func (c *CheckBox) SetPaddingRight(padding int)
- func (c *CheckBox) SetPaddingTop(padding int)
- func (c *CheckBox) SetPosX(posX float64)
- func (c *CheckBox) SetPosY(posY float64)
- func (c *CheckBox) SetPosition(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 ComponentFocusedEventArgs
- type ComponentFocusedHandlerFunc
- type ComponentMouseButtonJustPressedEventArgs
- type ComponentMouseButtonJustPressedHandlerFunc
- type ComponentMouseButtonPressedEventArgs
- type ComponentMouseButtonPressedHandlerFunc
- type ComponentMouseButtonReleasedEventArgs
- type ComponentMouseButtonReleasedHandlerFunc
- type ComponentOptions
- type Container
- func (c *Container) AbsPosX() float64
- func (c *Container) AbsPosY() float64
- func (c *Container) AbsPosition() (posX float64, posY float64)
- func (c *Container) AddComponent(component Component)
- func (c *Container) AddComponents(components ...Component)
- func (c *Container) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) Component
- func (c *Container) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) Component
- func (c *Container) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *Container) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) Component
- func (c *Container) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) Component
- func (c *Container) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) Component
- func (c *Container) Dimensions() (int, int)
- func (c *Container) Disable() bool
- func (c *Container) Draw() *ebiten.Image
- func (c *Container) EventManager() *event.Manager
- func (c *Container) FireEvents()
- func (c *Container) Focused() bool
- func (c *Container) GetBackgroundColor() imgColor.RGBA
- func (c *Container) Height() int
- func (c *Container) HeightWithPadding() int
- func (c *Container) Hidden() bool
- func (c *Container) PosX() float64
- func (c *Container) PosY() float64
- func (c *Container) Position() (float64, float64)
- func (c *Container) SetBackgroundColor(color imgColor.RGBA)
- func (c *Container) SetDimensions(width, height int)
- func (c *Container) SetDisabled(disabled bool)
- func (c *Container) SetEventManager(eventManager *event.Manager)
- func (c *Container) SetFocused(focused bool)
- func (c *Container) SetHeight(height int)
- func (c *Container) SetHidden(hidden bool)
- func (c *Container) SetPadding(padding Padding)
- func (c *Container) SetPaddingBottom(padding int)
- func (c *Container) SetPaddingLeft(padding int)
- func (c *Container) SetPaddingRight(padding int)
- func (c *Container) SetPaddingTop(padding int)
- func (c *Container) SetPosX(posX float64)
- func (c *Container) SetPosY(posY float64)
- func (c *Container) SetPosition(posX, posY float64)
- func (c *Container) SetWidth(width int)
- func (c *Container) Width() int
- func (c *Container) WidthWithPadding() int
- type ContainerOptions
- type DefaultButtonDrawer
- type DefaultCheckBoxDrawer
- type DefaultSliderDrawer
- type DefaultTextInputCursorDrawer
- type DefaultTextInputDrawer
- 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) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *Label) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager() *event.Manager
- func (c *Label) FireEvents()
- func (c *Label) Focused() bool
- 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) SetEventManager(eventManager *event.Manager)
- func (c *Label) SetFocused(focused bool)
- func (c *Label) SetHeight(height int)
- func (c *Label) SetHidden(hidden bool)
- func (c *Label) SetPadding(padding Padding)
- func (c *Label) SetPaddingBottom(padding int)
- func (c *Label) SetPaddingLeft(padding int)
- func (c *Label) SetPaddingRight(padding int)
- func (c *Label) SetPaddingTop(padding int)
- func (l *Label) SetPosX(posX float64)
- func (l *Label) SetPosY(posY float64)
- func (l *Label) SetPosistion(posX, posY float64)
- func (c *Label) SetPosition(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) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *Slider) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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 (c *Slider) EventManager() *event.Manager
- func (s *Slider) FireEvents()
- func (c *Slider) Focused() bool
- 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) SetEventManager(eventManager *event.Manager)
- func (c *Slider) SetFocused(focused bool)
- func (c *Slider) SetHeight(height int)
- func (c *Slider) SetHidden(hidden bool)
- func (c *Slider) SetPadding(padding Padding)
- func (c *Slider) SetPaddingBottom(padding int)
- func (c *Slider) SetPaddingLeft(padding int)
- func (c *Slider) SetPaddingRight(padding int)
- func (c *Slider) SetPaddingTop(padding int)
- func (c *Slider) SetPosX(posX float64)
- func (c *Slider) SetPosY(posY float64)
- func (s *Slider) SetPosition(posX, posY float64)
- func (s *Slider) SetToMax()
- func (s *Slider) SetToMin()
- 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) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *Sprite) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager() *event.Manager
- func (c *Sprite) FireEvents()
- func (c *Sprite) Focused() bool
- 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) SetEventManager(eventManager *event.Manager)
- func (c *Sprite) SetFocused(focused bool)
- func (c *Sprite) SetHeight(height int)
- func (c *Sprite) SetHidden(hidden bool)
- func (s *Sprite) SetImage(image *ebiten.Image)
- func (c *Sprite) SetPadding(padding Padding)
- func (c *Sprite) SetPaddingBottom(padding int)
- func (c *Sprite) SetPaddingLeft(padding int)
- func (c *Sprite) SetPaddingRight(padding int)
- func (c *Sprite) SetPaddingTop(padding int)
- func (c *Sprite) SetPosX(posX float64)
- func (c *Sprite) SetPosY(posY float64)
- func (c *Sprite) SetPosition(posX, posY float64)
- func (c *Sprite) SetWidth(width int)
- func (c *Sprite) Width() int
- func (c *Sprite) WidthWithPadding() int
- type SpriteOptions
- type TextInput
- func (c *TextInput) AbsPosX() float64
- func (c *TextInput) AbsPosY() float64
- func (c *TextInput) AbsPosition() (posX float64, posY float64)
- func (ti *TextInput) AddChangedHandler(f TextInputChangedHandlerFunc) *TextInput
- func (ti *TextInput) AddClickedHandler(f TextInputClickedHandlerFunc) *TextInput
- func (c *TextInput) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) Component
- func (c *TextInput) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) Component
- func (c *TextInput) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
- func (c *TextInput) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) Component
- func (c *TextInput) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) Component
- func (c *TextInput) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) Component
- func (ti *TextInput) AddSubmittedHandler(f TextInputSubmittedHandlerFunc) *TextInput
- func (ti *TextInput) Backspace()
- func (ti *TextInput) BackspaceToBegining()
- func (ti *TextInput) BackspaceWord()
- func (ti *TextInput) Copy()
- func (ti *TextInput) CursorLeft()
- func (ti *TextInput) CursorRight()
- func (ti *TextInput) Cut()
- func (ti *TextInput) Delete()
- func (ti *TextInput) DeleteToEnd()
- func (ti *TextInput) DeleteWord()
- func (ti *TextInput) Deselect()
- func (c *TextInput) Dimensions() (int, int)
- func (c *TextInput) Disable() bool
- func (ti *TextInput) Draw() *ebiten.Image
- func (ti *TextInput) End()
- func (c *TextInput) EventManager() *event.Manager
- func (c *TextInput) FireEvents()
- func (c *TextInput) Focused() bool
- func (ti *TextInput) GetSelectedText() string
- func (ti *TextInput) HasSelectedText() bool
- func (c *TextInput) Height() int
- func (c *TextInput) HeightWithPadding() int
- func (c *TextInput) Hidden() bool
- func (ti *TextInput) Home()
- func (ti *TextInput) Insert(chars []rune)
- func (ti *TextInput) Paste()
- func (c *TextInput) PosX() float64
- func (c *TextInput) PosY() float64
- func (c *TextInput) Position() (float64, float64)
- func (ti *TextInput) Redo()
- func (ti *TextInput) RemoveLine()
- func (ti *TextInput) RemoveSelection()
- func (ti *TextInput) SelectAll()
- func (c *TextInput) SetDimensions(width, height int)
- func (c *TextInput) SetDisabled(disabled bool)
- func (c *TextInput) SetEventManager(eventManager *event.Manager)
- func (c *TextInput) SetFocused(focused bool)
- func (c *TextInput) SetHeight(height int)
- func (c *TextInput) SetHidden(hidden bool)
- func (c *TextInput) SetPadding(padding Padding)
- func (c *TextInput) SetPaddingBottom(padding int)
- func (c *TextInput) SetPaddingLeft(padding int)
- func (c *TextInput) SetPaddingRight(padding int)
- func (c *TextInput) SetPaddingTop(padding int)
- func (c *TextInput) SetPosX(posX float64)
- func (c *TextInput) SetPosY(posY float64)
- func (c *TextInput) SetPosition(posX, posY float64)
- func (ti *TextInput) SetValue(value string)
- func (c *TextInput) SetWidth(width int)
- func (ti *TextInput) Submit()
- func (ti *TextInput) Undo()
- func (ti *TextInput) Unfocus()
- func (ti *TextInput) Value() string
- func (c *TextInput) Width() int
- func (c *TextInput) WidthWithPadding() int
- func (ti *TextInput) WordLeft()
- func (ti *TextInput) WordRight()
- type TextInputChangedEventArgs
- type TextInputChangedHandlerFunc
- type TextInputClickedEventArgs
- type TextInputClickedHandlerFunc
- type TextInputCursorDrawer
- type TextInputCursorOptions
- type TextInputDrawer
- type TextInputOnSubmitFunc
- type TextInputOptions
- type TextInputPressedEventArgs
- type TextInputPressedHandlerFunc
- type TextInputReleasedEventArgs
- type TextInputReleasedHandlerFunc
- type TextInputSubmittedEventArgs
- type TextInputSubmittedHandlerFunc
- type TextInputValidationFunc
- 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(opt *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) AddFocusedHandler ¶ added in v0.7.0
func (c *Button) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*Button) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *Button) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager ¶ added in v0.7.0
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) SetEventManager ¶ added in v0.7.0
func (*Button) SetFocused ¶ added in v0.7.0
func (c *Button) SetFocused(focused bool)
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) SetPadding ¶ added in v0.7.0
func (c *Button) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*Button) SetPaddingBottom ¶ added in v0.7.0
func (c *Button) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*Button) SetPaddingLeft ¶ added in v0.7.0
func (c *Button) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*Button) SetPaddingRight ¶ added in v0.7.0
func (c *Button) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*Button) SetPaddingTop ¶ added in v0.7.0
func (c *Button) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
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) SetPosition ¶ added in v0.7.0
func (c *Button) SetPosition(posX, posY float64)
SetPosition 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 ButtonPressedEventArgs ¶
type ButtonPressedEventArgs struct {
Button *Button
}
type ButtonPressedHandlerFunc ¶
type ButtonPressedHandlerFunc func(args *ButtonPressedEventArgs)
type ButtonReleasedEventArgs ¶
type ButtonReleasedHandlerFunc ¶
type ButtonReleasedHandlerFunc func(args *ButtonReleasedEventArgs)
type CheckBox ¶
func NewCheckBox ¶
func NewCheckBox(opt *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) AddFocusedHandler ¶ added in v0.7.0
func (c *CheckBox) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*CheckBox) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *CheckBox) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager ¶ added in v0.7.0
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) SetEventManager ¶ added in v0.7.0
func (*CheckBox) SetFocused ¶ added in v0.7.0
func (c *CheckBox) SetFocused(focused bool)
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) SetPadding ¶ added in v0.7.0
func (c *CheckBox) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*CheckBox) SetPaddingBottom ¶ added in v0.7.0
func (c *CheckBox) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*CheckBox) SetPaddingLeft ¶ added in v0.7.0
func (c *CheckBox) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*CheckBox) SetPaddingRight ¶ added in v0.7.0
func (c *CheckBox) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*CheckBox) SetPaddingTop ¶ added in v0.7.0
func (c *CheckBox) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
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) SetPosition ¶ added in v0.7.0
func (c *CheckBox) SetPosition(posX, posY float64)
SetPosition 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 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 during ebiten.Draw(). 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) // SetPosition sets the component's position (x and y) SetPosition(posX, posY float64) // SetPadding sets the component's padding. SetPadding(padding Padding) // SetPaddingTop sets the component's padding top. SetPaddingTop(padding int) // SetPaddingBottom sets the component's padding bottom. SetPaddingBottom(padding int) // SetPaddingLeft sets the component's padding left. SetPaddingLeft(padding int) // SetPaddingRight sets the component's padding right. SetPaddingRight(padding int) Focused() bool SetFocused(bool) EventManager() *event.Manager SetEventManager(*event.Manager) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component // 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 ComponentFocusedEventArgs ¶ added in v0.7.0
type ComponentFocusedHandlerFunc ¶ added in v0.7.0
type ComponentFocusedHandlerFunc func(args *ComponentFocusedEventArgs) //nolint:golint
type ComponentMouseButtonJustPressedEventArgs ¶ added in v0.7.0
type ComponentMouseButtonJustPressedEventArgs struct { Component Component Button ebiten.MouseButton }
ComponentMouseButtonPressedEventArgs are the arguments for mouse button press events.
type ComponentMouseButtonJustPressedHandlerFunc ¶ added in v0.7.0
type ComponentMouseButtonJustPressedHandlerFunc func(args *ComponentMouseButtonJustPressedEventArgs) //nolint:golint
ComponentMouseButtonJustPressedHandlerFunc is a function that handles mouse button press events.
type ComponentMouseButtonPressedEventArgs ¶
type ComponentMouseButtonPressedEventArgs struct { Component Component Button ebiten.MouseButton Inside bool }
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 struct {
// contains filtered or unexported fields
}
func NewContainer ¶ added in v0.5.0
func NewContainer(opt *ContainerOptions) *Container
Newcontainer creates a new simple container
func (*Container) AbsPosX ¶ added in v0.7.0
func (c *Container) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*Container) AbsPosY ¶ added in v0.7.0
func (c *Container) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*Container) AbsPosition ¶ added in v0.7.0
AbsPosition return the component's absolute position.
func (*Container) AddComponent ¶
AddComponent adds a component to the container
func (*Container) AddComponents ¶ added in v0.7.0
AddComponents adds components to the container
func (*Container) AddCursorEnterHandler ¶ added in v0.7.0
func (c *Container) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) Component
func (*Container) AddCursorExitHandler ¶ added in v0.7.0
func (c *Container) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) Component
func (*Container) AddFocusedHandler ¶ added in v0.7.0
func (c *Container) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*Container) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *Container) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) Component
func (*Container) AddMouseButtonPressedHandler ¶ added in v0.7.0
func (c *Container) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) Component
func (*Container) AddMouseButtonReleasedHandler ¶ added in v0.7.0
func (c *Container) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) Component
func (*Container) Dimensions ¶ added in v0.7.0
Dimensions returns the component's size (width and height).
func (*Container) Disable ¶ added in v0.7.0
func (c *Container) Disable() bool
Disable returns the component's disabled state.
func (*Container) Draw ¶ added in v0.7.0
Draw draws the container's components, executes deferred events and returns the image.
func (*Container) EventManager ¶ added in v0.7.0
func (*Container) FireEvents ¶ added in v0.7.0
func (c *Container) FireEvents()
FireEvents fires the container's components deferred events
func (*Container) GetBackgroundColor ¶
GetBackgroundColor gets the container's background color
func (*Container) Height ¶ added in v0.7.0
func (c *Container) Height() int
Height returns the component's height.
func (*Container) HeightWithPadding ¶ added in v0.7.0
func (c *Container) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*Container) Hidden ¶ added in v0.7.0
func (c *Container) Hidden() bool
Hidden returns the component's hidden state.
func (*Container) PosX ¶ added in v0.7.0
func (c *Container) PosX() float64
PosX returns the component's position X.
func (*Container) PosY ¶ added in v0.7.0
func (c *Container) PosY() float64
PosY returns the component's position Y.
func (*Container) SetBackgroundColor ¶
SetBackgroundColor sets the container's background color
func (*Container) SetDimensions ¶ added in v0.7.0
func (c *Container) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*Container) SetDisabled ¶ added in v0.7.0
SetDisabled sets the container's and its component disabled states
func (*Container) SetEventManager ¶ added in v0.7.0
func (*Container) SetFocused ¶ added in v0.7.0
func (c *Container) SetFocused(focused bool)
func (*Container) SetHeight ¶ added in v0.7.0
func (c *Container) SetHeight(height int)
SetHeight sets the component's height.
func (*Container) SetHidden ¶ added in v0.7.0
func (c *Container) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
func (*Container) SetPadding ¶ added in v0.7.0
func (c *Container) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*Container) SetPaddingBottom ¶ added in v0.7.0
func (c *Container) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*Container) SetPaddingLeft ¶ added in v0.7.0
func (c *Container) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*Container) SetPaddingRight ¶ added in v0.7.0
func (c *Container) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*Container) SetPaddingTop ¶ added in v0.7.0
func (c *Container) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
func (*Container) SetPosX ¶ added in v0.7.0
func (c *Container) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*Container) SetPosY ¶ added in v0.7.0
func (c *Container) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*Container) SetPosition ¶ added in v0.7.0
func (c *Container) SetPosition(posX, posY float64)
SetPosition sets the component's position (x and y).
func (*Container) SetWidth ¶ added in v0.7.0
func (c *Container) SetWidth(width int)
SetWidth sets the component's width.
func (*Container) Width ¶ added in v0.7.0
func (c *Container) Width() int
Width returns the component's width.
func (*Container) WidthWithPadding ¶ added in v0.7.0
func (c *Container) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
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 DefaultTextInputCursorDrawer ¶ added in v0.7.0
func (*DefaultTextInputCursorDrawer) Draw ¶ added in v0.7.0
func (d *DefaultTextInputCursorDrawer) Draw(cursor *textInputCursor) *ebiten.Image
type DefaultTextInputDrawer ¶ added in v0.7.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(text string, opt *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) AddFocusedHandler ¶ added in v0.7.0
func (c *Label) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*Label) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *Label) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager ¶ added in v0.7.0
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) SetEventManager ¶ added in v0.7.0
func (*Label) SetFocused ¶ added in v0.7.0
func (c *Label) SetFocused(focused bool)
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) SetPadding ¶ added in v0.7.0
func (c *Label) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*Label) SetPaddingBottom ¶ added in v0.7.0
func (c *Label) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*Label) SetPaddingLeft ¶ added in v0.7.0
func (c *Label) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*Label) SetPaddingRight ¶ added in v0.7.0
func (c *Label) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*Label) SetPaddingTop ¶ added in v0.7.0
func (c *Label) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
func (*Label) SetPosistion ¶
func (*Label) SetPosition ¶ added in v0.7.0
func (c *Label) SetPosition(posX, posY float64)
SetPosition sets the component's position (x and y).
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 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(opt *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) AddFocusedHandler ¶ added in v0.7.0
func (c *Slider) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*Slider) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *Slider) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager ¶ added in v0.7.0
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) SetEventManager ¶ added in v0.7.0
func (*Slider) SetFocused ¶ added in v0.7.0
func (c *Slider) SetFocused(focused bool)
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) SetPadding ¶ added in v0.7.0
func (c *Slider) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*Slider) SetPaddingBottom ¶ added in v0.7.0
func (c *Slider) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*Slider) SetPaddingLeft ¶ added in v0.7.0
func (c *Slider) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*Slider) SetPaddingRight ¶ added in v0.7.0
func (c *Slider) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*Slider) SetPaddingTop ¶ added in v0.7.0
func (c *Slider) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
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) SetPosition ¶ added in v0.7.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 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) AddFocusedHandler ¶ added in v0.7.0
func (c *Sprite) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*Sprite) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *Sprite) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) 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) EventManager ¶ added in v0.7.0
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) SetEventManager ¶ added in v0.7.0
func (*Sprite) SetFocused ¶ added in v0.7.0
func (c *Sprite) SetFocused(focused bool)
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) SetPadding ¶ added in v0.7.0
func (c *Sprite) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*Sprite) SetPaddingBottom ¶ added in v0.7.0
func (c *Sprite) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*Sprite) SetPaddingLeft ¶ added in v0.7.0
func (c *Sprite) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*Sprite) SetPaddingRight ¶ added in v0.7.0
func (c *Sprite) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*Sprite) SetPaddingTop ¶ added in v0.7.0
func (c *Sprite) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
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) SetPosition ¶ added in v0.7.0
func (c *Sprite) SetPosition(posX, posY float64)
SetPosition 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 TextInput ¶ added in v0.7.0
type TextInput struct { ClickedEvent *event.Event PressedEvent *event.Event ReleasedEvent *event.Event ChangedEvent *event.Event SubmittedEvent *event.Event // contains filtered or unexported fields }
func NewTextInput ¶ added in v0.7.0
func NewTextInput(options *TextInputOptions) *TextInput
func (*TextInput) AbsPosX ¶ added in v0.7.0
func (c *TextInput) AbsPosX() float64
AbsPosX returns the component's absolute position X.
func (*TextInput) AbsPosY ¶ added in v0.7.0
func (c *TextInput) AbsPosY() float64
AbsPosY returns the component's absolute position Y.
func (*TextInput) AbsPosition ¶ added in v0.7.0
AbsPosition return the component's absolute position.
func (*TextInput) AddChangedHandler ¶ added in v0.7.0
func (ti *TextInput) AddChangedHandler(f TextInputChangedHandlerFunc) *TextInput
func (*TextInput) AddClickedHandler ¶ added in v0.7.0
func (ti *TextInput) AddClickedHandler(f TextInputClickedHandlerFunc) *TextInput
func (*TextInput) AddCursorEnterHandler ¶ added in v0.7.0
func (c *TextInput) AddCursorEnterHandler(f ComponentCursorEnterHandlerFunc) Component
func (*TextInput) AddCursorExitHandler ¶ added in v0.7.0
func (c *TextInput) AddCursorExitHandler(f ComponentCursorExitHandlerFunc) Component
func (*TextInput) AddFocusedHandler ¶ added in v0.7.0
func (c *TextInput) AddFocusedHandler(f ComponentFocusedHandlerFunc) Component
func (*TextInput) AddMouseButtonJustPressedHandler ¶ added in v0.7.0
func (c *TextInput) AddMouseButtonJustPressedHandler(f ComponentMouseButtonJustPressedHandlerFunc) Component
func (*TextInput) AddMouseButtonPressedHandler ¶ added in v0.7.0
func (c *TextInput) AddMouseButtonPressedHandler(f ComponentMouseButtonPressedHandlerFunc) Component
func (*TextInput) AddMouseButtonReleasedHandler ¶ added in v0.7.0
func (c *TextInput) AddMouseButtonReleasedHandler(f ComponentMouseButtonReleasedHandlerFunc) Component
func (*TextInput) AddSubmittedHandler ¶ added in v0.7.0
func (ti *TextInput) AddSubmittedHandler(f TextInputSubmittedHandlerFunc) *TextInput
func (*TextInput) BackspaceToBegining ¶ added in v0.7.0
func (ti *TextInput) BackspaceToBegining()
func (*TextInput) BackspaceWord ¶ added in v0.7.0
func (ti *TextInput) BackspaceWord()
func (*TextInput) CursorLeft ¶ added in v0.7.0
func (ti *TextInput) CursorLeft()
func (*TextInput) CursorRight ¶ added in v0.7.0
func (ti *TextInput) CursorRight()
func (*TextInput) DeleteToEnd ¶ added in v0.7.0
func (ti *TextInput) DeleteToEnd()
func (*TextInput) DeleteWord ¶ added in v0.7.0
func (ti *TextInput) DeleteWord()
func (*TextInput) Dimensions ¶ added in v0.7.0
Dimensions returns the component's size (width and height).
func (*TextInput) Disable ¶ added in v0.7.0
func (c *TextInput) Disable() bool
Disable returns the component's disabled state.
func (*TextInput) EventManager ¶ added in v0.7.0
func (*TextInput) FireEvents ¶ added in v0.7.0
func (c *TextInput) FireEvents()
FireEvents checks if the mouse cursor is inside the component and fires events accordingly.
func (*TextInput) GetSelectedText ¶ added in v0.7.0
func (*TextInput) HasSelectedText ¶ added in v0.7.0
func (*TextInput) Height ¶ added in v0.7.0
func (c *TextInput) Height() int
Height returns the component's height.
func (*TextInput) HeightWithPadding ¶ added in v0.7.0
func (c *TextInput) HeightWithPadding() int
HeightWithPadding returns the component's height with top and bottom paddings.
func (*TextInput) Hidden ¶ added in v0.7.0
func (c *TextInput) Hidden() bool
Hidden returns the component's hidden state.
func (*TextInput) PosX ¶ added in v0.7.0
func (c *TextInput) PosX() float64
PosX returns the component's position X.
func (*TextInput) PosY ¶ added in v0.7.0
func (c *TextInput) PosY() float64
PosY returns the component's position Y.
func (*TextInput) RemoveLine ¶ added in v0.7.0
func (ti *TextInput) RemoveLine()
func (*TextInput) RemoveSelection ¶ added in v0.7.0
func (ti *TextInput) RemoveSelection()
func (*TextInput) SetDimensions ¶ added in v0.7.0
func (c *TextInput) SetDimensions(width, height int)
SetDimensions sets the component's dimensions (width and height).
func (*TextInput) SetDisabled ¶ added in v0.7.0
func (c *TextInput) SetDisabled(disabled bool)
SetDisabled sets the component's disabled state.
func (*TextInput) SetEventManager ¶ added in v0.7.0
func (*TextInput) SetFocused ¶ added in v0.7.0
func (c *TextInput) SetFocused(focused bool)
func (*TextInput) SetHeight ¶ added in v0.7.0
func (c *TextInput) SetHeight(height int)
SetHeight sets the component's height.
func (*TextInput) SetHidden ¶ added in v0.7.0
func (c *TextInput) SetHidden(hidden bool)
SetHidden sets the component's hidden state.
func (*TextInput) SetPadding ¶ added in v0.7.0
func (c *TextInput) SetPadding(padding Padding)
SetPadding sets the component's padding.
func (*TextInput) SetPaddingBottom ¶ added in v0.7.0
func (c *TextInput) SetPaddingBottom(padding int)
SetPaddingBottom sets the component's padding bottom.
func (*TextInput) SetPaddingLeft ¶ added in v0.7.0
func (c *TextInput) SetPaddingLeft(padding int)
SetPaddingLeft sets the component's padding left.
func (*TextInput) SetPaddingRight ¶ added in v0.7.0
func (c *TextInput) SetPaddingRight(padding int)
SetPaddingRight sets the component's padding right.
func (*TextInput) SetPaddingTop ¶ added in v0.7.0
func (c *TextInput) SetPaddingTop(padding int)
SetPaddingTop sets the component's padding top.
func (*TextInput) SetPosX ¶ added in v0.7.0
func (c *TextInput) SetPosX(posX float64)
SetPosX sets the component's position X.
func (*TextInput) SetPosY ¶ added in v0.7.0
func (c *TextInput) SetPosY(posY float64)
SetPosY sets the component's position Y.
func (*TextInput) SetPosition ¶ added in v0.7.0
func (c *TextInput) SetPosition(posX, posY float64)
SetPosition sets the component's position (x and y).
func (*TextInput) SetWidth ¶ added in v0.7.0
func (c *TextInput) SetWidth(width int)
SetWidth sets the component's width.
func (*TextInput) Width ¶ added in v0.7.0
func (c *TextInput) Width() int
Width returns the component's width.
func (*TextInput) WidthWithPadding ¶ added in v0.7.0
func (c *TextInput) WidthWithPadding() int
WidthWithPadding returns the component's width with left and right paddings.
type TextInputChangedEventArgs ¶ added in v0.7.0
type TextInputChangedHandlerFunc ¶ added in v0.7.0
type TextInputChangedHandlerFunc func(args *TextInputChangedEventArgs)
type TextInputClickedEventArgs ¶ added in v0.7.0
type TextInputClickedEventArgs struct {
TextInput *TextInput
}
type TextInputClickedHandlerFunc ¶ added in v0.7.0
type TextInputClickedHandlerFunc func(args *TextInputClickedEventArgs)
type TextInputCursorDrawer ¶ added in v0.7.0
type TextInputCursorOptions ¶ added in v0.7.0
type TextInputCursorOptions struct { Width option.OptInt Height option.OptInt Drawer TextInputCursorDrawer }
type TextInputDrawer ¶ added in v0.7.0
type TextInputOnSubmitFunc ¶ added in v0.7.0
type TextInputOptions ¶ added in v0.7.0
type TextInputOptions struct { Width option.OptInt Height option.OptInt Drawer TextInputDrawer Color color.Color ColorDisabled color.Color ColorHovered color.Color Font font.Face Padding *Padding OnSubmitFunc TextInputOnSubmitFunc InputValidationFunc TextInputValidationFunc SubmitOnUnfocus bool CursorOptions *TextInputCursorOptions }
type TextInputPressedEventArgs ¶ added in v0.7.0
type TextInputPressedEventArgs struct {
TextInput *TextInput
}
type TextInputPressedHandlerFunc ¶ added in v0.7.0
type TextInputPressedHandlerFunc func(args *TextInputClickedEventArgs)
type TextInputReleasedEventArgs ¶ added in v0.7.0
type TextInputReleasedHandlerFunc ¶ added in v0.7.0
type TextInputReleasedHandlerFunc func(args *TextInputReleasedEventArgs)
type TextInputSubmittedEventArgs ¶ added in v0.7.0
type TextInputSubmittedHandlerFunc ¶ added in v0.7.0
type TextInputSubmittedHandlerFunc func(args *TextInputSubmittedEventArgs)
type TextInputValidationFunc ¶ added in v0.7.0
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)