component

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

func (c *Button) AbsPosition() (posX float64, posY float64)

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

func (c *Button) Dimensions() (int, int)

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) Draw

func (b *Button) Draw() *ebiten.Image

func (*Button) EventManager added in v0.7.0

func (c *Button) EventManager() *event.Manager

func (*Button) FireEvents

func (c *Button) FireEvents()

FireEvents checks if the mouse cursor is inside the component and fires events accordingly.

func (*Button) Focused added in v0.7.0

func (c *Button) Focused() bool

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) Position

func (c *Button) Position() (float64, float64)

Position returns the component's position (x and 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 (c *Button) SetEventManager(eventManager *event.Manager)

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

func (b *Button) SetLabel(label *Label)

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) SetWidth

func (c *Button) SetWidth(width int)

SetWidth sets the component's width.

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 ButtonDrawer interface {
	Draw(*Button) *ebiten.Image
}

type ButtonOptions

type ButtonOptions struct {
	Width  option.OptInt
	Height option.OptInt

	Drawer ButtonDrawer

	Label *Label

	Padding *Padding
}

type ButtonPressedEventArgs

type ButtonPressedEventArgs struct {
	Button *Button
}

type ButtonPressedHandlerFunc

type ButtonPressedHandlerFunc func(args *ButtonPressedEventArgs)

type ButtonReleasedEventArgs

type ButtonReleasedEventArgs struct {
	Button *Button
	Inside bool
}

type ButtonReleasedHandlerFunc

type ButtonReleasedHandlerFunc func(args *ButtonReleasedEventArgs)

type CheckBox

type CheckBox struct {
	ToggledEvent *event.Event
	// contains filtered or unexported fields
}

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

func (c *CheckBox) AbsPosition() (posX float64, posY float64)

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) Checked

func (cb *CheckBox) Checked() bool

func (*CheckBox) Dimensions added in v0.4.0

func (c *CheckBox) Dimensions() (int, int)

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) Draw

func (cb *CheckBox) Draw() *ebiten.Image

func (*CheckBox) EventManager added in v0.7.0

func (c *CheckBox) EventManager() *event.Manager

func (*CheckBox) FireEvents

func (c *CheckBox) FireEvents()

FireEvents checks if the mouse cursor is inside the component and fires events accordingly.

func (*CheckBox) Focused added in v0.7.0

func (c *CheckBox) Focused() bool

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) Position

func (c *CheckBox) Position() (float64, float64)

Position returns the component's position (x and y).

func (*CheckBox) Set

func (cb *CheckBox) Set(checked bool)

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 (c *CheckBox) SetEventManager(eventManager *event.Manager)

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

func (cb *CheckBox) SetLabel(label *Label)

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) Toggle

func (cb *CheckBox) Toggle()

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 CheckBoxDrawer interface {
	Draw(checkbox *CheckBox) *ebiten.Image
}

type CheckBoxOptions

type CheckBoxOptions struct {
	Width  option.OptInt
	Height option.OptInt

	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 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 ComponentFocusedEventArgs struct {
	Component Component
	Focused   bool
}

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

type ComponentOptions struct {
	Padding  *Padding
	Disabled bool
	Hidden   bool
}

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

func (c *Container) AbsPosition() (posX float64, posY float64)

AbsPosition return the component's absolute position.

func (*Container) AddComponent

func (c *Container) AddComponent(component Component)

AddComponent adds a component to the container

func (*Container) AddComponents added in v0.7.0

func (c *Container) AddComponents(components ...Component)

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

func (c *Container) Dimensions() (int, int)

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

func (c *Container) Draw() *ebiten.Image

Draw draws the container's components, executes deferred events and returns the image.

func (*Container) EventManager added in v0.7.0

func (c *Container) EventManager() *event.Manager

func (*Container) FireEvents added in v0.7.0

func (c *Container) FireEvents()

FireEvents fires the container's components deferred events

func (*Container) Focused added in v0.7.0

func (c *Container) Focused() bool

func (*Container) GetBackgroundColor

func (c *Container) GetBackgroundColor() imgColor.RGBA

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) Position added in v0.7.0

func (c *Container) Position() (float64, float64)

Position returns the component's position (x and y).

func (*Container) SetBackgroundColor

func (c *Container) SetBackgroundColor(color imgColor.RGBA)

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

func (c *Container) SetDisabled(disabled bool)

SetDisabled sets the container's and its component disabled states

func (*Container) SetEventManager added in v0.7.0

func (c *Container) SetEventManager(eventManager *event.Manager)

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 ContainerOptions struct {
	Layout Layout

	Width  option.OptInt
	Height option.OptInt

	Padding *Padding
}

type DefaultButtonDrawer added in v0.6.0

type DefaultButtonDrawer struct {
	Color         color.RGBA
	ColorPressed  color.RGBA
	ColorHovered  color.RGBA
	ColorDisabled color.RGBA
}

func (DefaultButtonDrawer) Draw added in v0.6.0

func (d DefaultButtonDrawer) Draw(bttn *Button) *ebiten.Image

type DefaultCheckBoxDrawer added in v0.6.0

type DefaultCheckBoxDrawer struct {
	Color color.RGBA
}

func (DefaultCheckBoxDrawer) Draw added in v0.6.0

type DefaultSliderDrawer added in v0.6.0

type DefaultSliderDrawer struct {
	Color         color.RGBA
	ColorPressed  color.RGBA
	ColorHovered  color.RGBA
	ColorDisabled color.RGBA
}

func (DefaultSliderDrawer) Draw added in v0.6.0

func (d DefaultSliderDrawer) Draw(slider *Slider) *ebiten.Image

type DefaultTextInputCursorDrawer added in v0.7.0

type DefaultTextInputCursorDrawer struct {
	Color color.RGBA
}

func (*DefaultTextInputCursorDrawer) Draw added in v0.7.0

func (d *DefaultTextInputCursorDrawer) Draw(cursor *textInputCursor) *ebiten.Image

type DefaultTextInputDrawer added in v0.7.0

type DefaultTextInputDrawer struct {
	Color           color.RGBA
	ColorDisabled   color.RGBA
	ColorHovered    color.RGBA
	BackgroundColor color.Color
	// contains filtered or unexported fields
}

func (*DefaultTextInputDrawer) Draw added in v0.7.0

func (d *DefaultTextInputDrawer) Draw(textInput *TextInput) *ebiten.Image

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

func (c *Label) AbsPosition() (posX float64, posY float64)

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

func (c *Label) Dimensions() (int, int)

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) Draw

func (l *Label) Draw() *ebiten.Image

func (*Label) EventManager added in v0.7.0

func (c *Label) EventManager() *event.Manager

func (*Label) FireEvents

func (c *Label) FireEvents()

FireEvents checks if the mouse cursor is inside the component and fires events accordingly.

func (*Label) Focused added in v0.7.0

func (c *Label) Focused() bool

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) Position

func (c *Label) Position() (float64, float64)

Position returns the component's position (x and 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 (c *Label) SetEventManager(eventManager *event.Manager)

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) SetPosX

func (l *Label) SetPosX(posX float64)

func (*Label) SetPosY

func (l *Label) SetPosY(posY float64)

func (*Label) SetPosistion

func (l *Label) SetPosistion(posX, posY float64)

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) SetText added in v0.5.0

func (l *Label) SetText(labelText string)

func (*Label) SetWidth

func (c *Label) SetWidth(width int)

SetWidth sets the component's width.

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

type Padding struct {
	Top    int
	Bottom int
	Left   int
	Right  int
}
var DefaultPadding Padding = Padding{
	Top:    0,
	Bottom: 0,
	Left:   0,
	Right:  0,
}

func NewPadding added in v0.5.0

func NewPadding(top, right, bottom, left int) *Padding

func (*Padding) Validate added in v0.5.0

func (p *Padding) Validate()

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

func (c *Slider) AbsPosition() (posX float64, posY float64)

AbsPosition return the component's absolute position.

func (*Slider) AddComponent added in v0.5.0

func (s *Slider) AddComponent(Component)

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

func (c *Slider) Dimensions() (int, int)

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) Draw added in v0.5.0

func (s *Slider) Draw() *ebiten.Image

func (*Slider) EventManager added in v0.7.0

func (c *Slider) EventManager() *event.Manager

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) Focused added in v0.7.0

func (c *Slider) Focused() bool

func (*Slider) GetBackgroundColor added in v0.5.0

func (s *Slider) GetBackgroundColor() color.RGBA

func (*Slider) GetValue added in v0.5.0

func (s *Slider) GetValue() float64

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) Position added in v0.5.0

func (c *Slider) Position() (float64, float64)

Position returns the component's position (x and y).

func (*Slider) Set added in v0.5.0

func (s *Slider) Set(value float64)

func (*Slider) SetBackgroundColor added in v0.5.0

func (s *Slider) SetBackgroundColor(color color.RGBA)

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 (s *Slider) SetDisabled(disabled bool)

func (*Slider) SetEventManager added in v0.7.0

func (c *Slider) SetEventManager(eventManager *event.Manager)

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 (s *Slider) SetPosition(posX, posY float64)

func (*Slider) SetToMax added in v0.7.0

func (s *Slider) SetToMax()

func (*Slider) SetToMin added in v0.7.0

func (s *Slider) SetToMin()

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 SliderDrawer interface {
	Draw(slider *Slider) *ebiten.Image
}

type SliderOptions added in v0.5.0

type SliderOptions struct {
	Min          option.OptFloat
	Max          option.OptFloat
	Step         option.OptFloat
	DefaultValue option.OptFloat

	Width  option.OptInt
	Height option.OptInt

	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 SliderReleasedEventArgs struct {
	Slider *Slider
	Inside bool
}

type SliderReleasedHandlerFunc added in v0.5.0

type SliderReleasedHandlerFunc func(args *SliderReleasedEventArgs)

type SliderSlidedEventArgs added in v0.5.0

type SliderSlidedEventArgs struct {
	Slider *Slider
	Value  float64
	Change float64
}

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

func (c *Sprite) AbsPosition() (posX float64, posY float64)

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

func (c *Sprite) Dimensions() (int, int)

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) Draw added in v0.6.0

func (s *Sprite) Draw() *ebiten.Image

func (*Sprite) EventManager added in v0.7.0

func (c *Sprite) EventManager() *event.Manager

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) Focused added in v0.7.0

func (c *Sprite) Focused() bool

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) Position added in v0.6.0

func (c *Sprite) Position() (float64, float64)

Position returns the component's position (x and 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 (c *Sprite) SetEventManager(eventManager *event.Manager)

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) SetImage added in v0.6.0

func (s *Sprite) SetImage(image *ebiten.Image)

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

func (c *TextInput) AbsPosition() (posX float64, posY float64)

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) Backspace added in v0.7.0

func (ti *TextInput) Backspace()

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) Copy added in v0.7.0

func (ti *TextInput) Copy()

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) Cut added in v0.7.0

func (ti *TextInput) Cut()

func (*TextInput) Delete added in v0.7.0

func (ti *TextInput) Delete()

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) Deselect added in v0.7.0

func (ti *TextInput) Deselect()

func (*TextInput) Dimensions added in v0.7.0

func (c *TextInput) Dimensions() (int, int)

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) Draw added in v0.7.0

func (ti *TextInput) Draw() *ebiten.Image

func (*TextInput) End added in v0.7.0

func (ti *TextInput) End()

func (*TextInput) EventManager added in v0.7.0

func (c *TextInput) EventManager() *event.Manager

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) Focused added in v0.7.0

func (c *TextInput) Focused() bool

func (*TextInput) GetSelectedText added in v0.7.0

func (ti *TextInput) GetSelectedText() string

func (*TextInput) HasSelectedText added in v0.7.0

func (ti *TextInput) HasSelectedText() bool

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) Home added in v0.7.0

func (ti *TextInput) Home()

func (*TextInput) Insert added in v0.7.0

func (ti *TextInput) Insert(chars []rune)

func (*TextInput) Paste added in v0.7.0

func (ti *TextInput) Paste()

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) Position added in v0.7.0

func (c *TextInput) Position() (float64, float64)

Position returns the component's position (x and y).

func (*TextInput) Redo added in v0.7.0

func (ti *TextInput) Redo()

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) SelectAll added in v0.7.0

func (ti *TextInput) SelectAll()

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 (c *TextInput) SetEventManager(eventManager *event.Manager)

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) SetValue added in v0.7.0

func (ti *TextInput) SetValue(value string)

SetValue sets the value of the text input.

func (*TextInput) SetWidth added in v0.7.0

func (c *TextInput) SetWidth(width int)

SetWidth sets the component's width.

func (*TextInput) Submit added in v0.7.0

func (ti *TextInput) Submit()

func (*TextInput) Undo added in v0.7.0

func (ti *TextInput) Undo()

func (*TextInput) Unfocus added in v0.7.0

func (ti *TextInput) Unfocus()

func (*TextInput) Value added in v0.7.0

func (ti *TextInput) Value() string

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.

func (*TextInput) WordLeft added in v0.7.0

func (ti *TextInput) WordLeft()

func (*TextInput) WordRight added in v0.7.0

func (ti *TextInput) WordRight()

type TextInputChangedEventArgs added in v0.7.0

type TextInputChangedEventArgs struct {
	TextInput *TextInput
	Text      string
}

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 TextInputCursorDrawer interface {
	Draw(*textInputCursor) *ebiten.Image
}

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 TextInputDrawer interface {
	Draw(textInput *TextInput) *ebiten.Image
}

type TextInputOnSubmitFunc added in v0.7.0

type TextInputOnSubmitFunc func(string) string

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 TextInputReleasedEventArgs struct {
	TextInput *TextInput
	Inside    bool
}

type TextInputReleasedHandlerFunc added in v0.7.0

type TextInputReleasedHandlerFunc func(args *TextInputReleasedEventArgs)

type TextInputSubmittedEventArgs added in v0.7.0

type TextInputSubmittedEventArgs struct {
	TextInput *TextInput
	Text      string
}

type TextInputSubmittedHandlerFunc added in v0.7.0

type TextInputSubmittedHandlerFunc func(args *TextInputSubmittedEventArgs)

type TextInputValidationFunc added in v0.7.0

type TextInputValidationFunc func(string) (bool, string)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL