Documentation ¶
Index ¶
- Variables
- func IsClicked(p Position, width, height int, btn ebiten.MouseButton) bool
- func IsHovered(p Position, width, height int) bool
- func IsInside(pos Position, width, height, x, y int) bool
- type Button
- type ButtonColorPalette
- type ButtonConfig
- type CenteredPosition
- type Component
- type DynamicPosition
- type Position
- type Text
- type TextColorPalette
- type TextConfig
- type TopLeftCornerPosition
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BackgroundColor = color.RGBA{R: 255, G: 255, B: 255, A: 255} ButtonColors = ButtonColorPalette{ BackgroundColor: color.RGBA{R: 18, G: 53, B: 91, A: 255}, BackgroundHoverColor: color.RGBA{R: 134, G: 22, B: 87, A: 255}, TextColor: color.RGBA{R: 212, G: 245, B: 245, A: 255}, TextHoverColor: color.RGBA{R: 212, G: 245, B: 245, A: 255}, } DisabledButtonColors = ButtonColorPalette{ BackgroundColor: color.RGBA{R: 42, G: 59, B: 82, A: 255}, BackgroundHoverColor: color.RGBA{R: 29, G: 37, B: 48, A: 255}, TextColor: color.RGBA{R: 212, G: 245, B: 245, A: 255}, } TextColors = TextColorPalette{ Color: color.RGBA{R: 87, G: 70, B: 123, A: 255}, HoverColor: color.RGBA{R: 82, G: 73, B: 72, A: 255}, } TitleColors = TextColorPalette{ Color: color.RGBA{R: 87, G: 70, B: 123, A: 255}, HoverColor: color.RGBA{R: 112, G: 248, B: 186, A: 255}, } )
Functions ¶
Types ¶
type Button ¶
type Button struct { Pos Position Callback func() // contains filtered or unexported fields }
func NewButton ¶
func NewButton(config ButtonConfig) *Button
func (*Button) Colors ¶
func (b *Button) Colors() *ButtonColorPalette
func (*Button) SetColors ¶
func (b *Button) SetColors(colors *ButtonColorPalette)
type ButtonColorPalette ¶
type ButtonConfig ¶
type ButtonConfig struct { Pos Position Text string Colors *ButtonColorPalette Callback func() }
type CenteredPosition ¶
type CenteredPosition struct {
X, Y int
}
func (CenteredPosition) TopLeftCorner ¶
func (c CenteredPosition) TopLeftCorner(width, height int) (int, int)
type DynamicPosition ¶
func (DynamicPosition) TopLeftCorner ¶
func (d DynamicPosition) TopLeftCorner(width, height int) (int, int)
type Text ¶
type Text struct { Pos Position Text string Colors *TextColorPalette Font font.Face }
func NewText ¶
func NewText(config TextConfig) *Text
type TextConfig ¶
type TextConfig struct { Pos Position Text string Colors *TextColorPalette Font font.Face }
type TopLeftCornerPosition ¶
type TopLeftCornerPosition struct {
X, Y int
}
func (TopLeftCornerPosition) TopLeftCorner ¶
func (t TopLeftCornerPosition) TopLeftCorner(int, int) (int, int)
Click to show internal directories.
Click to hide internal directories.