Documentation ¶
Index ¶
- type Action
- type Audio
- func (w *Audio) Click()
- func (a *Audio) Close()
- func (w Audio) Color(state StateWidget) Color
- func (w Audio) IsHover(x, y int32) bool
- func (w *Audio) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Audio) Position() Position
- func (a *Audio) Render(r *sdl.Renderer) error
- func (w *Audio) SetAction(a Action)
- func (w *Audio) SetActionColor(c Color)
- func (w *Audio) SetColor(c Color)
- func (w *Audio) SetHoverColor(c Color)
- func (w *Audio) SetPosition(x, y int32)
- func (w *Audio) SetSize(width, height int32)
- func (w *Audio) SetState(s StateWidget)
- func (a *Audio) SetStateToPlay(s StateWidget)
- func (w Audio) Size() (int32, int32)
- func (w Audio) State() StateWidget
- func (w *Audio) Unfocus()
- type Block
- type Color
- type Colors
- type Ellipse
- func (w *Ellipse) Click()
- func (e *Ellipse) Close()
- func (w Ellipse) Color(state StateWidget) Color
- func (e Ellipse) IsHover(x, y int32) bool
- func (w *Ellipse) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Ellipse) Position() Position
- func (e *Ellipse) Render(r *sdl.Renderer) error
- func (w *Ellipse) SetAction(a Action)
- func (w *Ellipse) SetActionColor(c Color)
- func (w *Ellipse) SetColor(c Color)
- func (w *Ellipse) SetHoverColor(c Color)
- func (e *Ellipse) SetPosition(x, y int32)
- func (e *Ellipse) SetSize(w, h int32)
- func (w *Ellipse) SetState(s StateWidget)
- func (e *Ellipse) SetStyle(s EllipseStyle)
- func (w Ellipse) Size() (int32, int32)
- func (w Ellipse) State() StateWidget
- func (w *Ellipse) Unfocus()
- type EllipseStyle
- type Font
- type Input
- func (i *Input) Click()
- func (w Input) Color(state StateWidget) Color
- func (w Input) IsHover(x, y int32) bool
- func (i *Input) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Input) Position() Position
- func (i *Input) Render(r *sdl.Renderer) error
- func (w *Input) SetAction(a Action)
- func (w *Input) SetActionColor(c Color)
- func (w *Input) SetColor(c Color)
- func (w *Input) SetHoverColor(c Color)
- func (w *Input) SetPosition(x, y int32)
- func (w *Input) SetSize(width, height int32)
- func (w *Input) SetState(s StateWidget)
- func (w Input) Size() (int32, int32)
- func (w Input) State() StateWidget
- func (w *Input) Unfocus()
- type Picture
- func (w *Picture) Click()
- func (p *Picture) Close()
- func (w Picture) Color(state StateWidget) Color
- func (w Picture) IsHover(x, y int32) bool
- func (w *Picture) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Picture) Position() Position
- func (p *Picture) Render(r *sdl.Renderer) error
- func (w *Picture) SetAction(a Action)
- func (w *Picture) SetActionColor(c Color)
- func (w *Picture) SetColor(c Color)
- func (p *Picture) SetHeightRatioWidth(height int32)
- func (w *Picture) SetHoverColor(c Color)
- func (w *Picture) SetPosition(x, y int32)
- func (w *Picture) SetSize(width, height int32)
- func (w *Picture) SetState(s StateWidget)
- func (p *Picture) SetWidthRatioHeight(width int32)
- func (w Picture) Size() (int32, int32)
- func (w Picture) State() StateWidget
- func (w *Picture) Unfocus()
- type Position
- type Rect
- func (w *Rect) Click()
- func (r *Rect) Close()
- func (w Rect) Color(state StateWidget) Color
- func (w Rect) IsHover(x, y int32) bool
- func (w *Rect) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Rect) Position() Position
- func (r *Rect) Render(renderer *sdl.Renderer) error
- func (w *Rect) SetAction(a Action)
- func (w *Rect) SetActionColor(c Color)
- func (w *Rect) SetColor(c Color)
- func (w *Rect) SetHoverColor(c Color)
- func (w *Rect) SetPosition(x, y int32)
- func (w *Rect) SetSize(width, height int32)
- func (w *Rect) SetState(s StateWidget)
- func (r *Rect) SetStyle(s RectStyle)
- func (w Rect) Size() (int32, int32)
- func (w Rect) State() StateWidget
- func (w *Rect) Unfocus()
- type RectStyle
- type StateWidget
- type Text
- func (w *Text) Click()
- func (t *Text) Close()
- func (w Text) Color(state StateWidget) Color
- func (w Text) IsHover(x, y int32) bool
- func (w *Text) KeyboardEvent(key *sdl.KeyboardEvent)
- func (w Text) Position() Position
- func (t *Text) Render(r *sdl.Renderer) error
- func (t *Text) Set(txt string)
- func (w *Text) SetAction(a Action)
- func (w *Text) SetActionColor(c Color)
- func (w *Text) SetColor(c Color)
- func (w *Text) SetHoverColor(c Color)
- func (w *Text) SetPosition(x, y int32)
- func (w *Text) SetSize(width, height int32)
- func (w *Text) SetState(s StateWidget)
- func (w Text) Size() (int32, int32)
- func (t *Text) SizeSTR() (int32, int32, error)
- func (w Text) State() StateWidget
- func (w *Text) Unfocus()
- type Widget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
Run() error
}
func NewFuncAction ¶
func NewFuncAction(f func()) Action
func NewLinkAction ¶
type Audio ¶
type Audio struct {
// contains filtered or unexported fields
}
func (Audio) Color ¶
func (w Audio) Color(state StateWidget) Color
func (*Audio) KeyboardEvent ¶
func (w *Audio) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Audio) SetActionColor ¶
func (w *Audio) SetActionColor(c Color)
func (*Audio) SetHoverColor ¶
func (w *Audio) SetHoverColor(c Color)
func (*Audio) SetPosition ¶
func (w *Audio) SetPosition(x, y int32)
func (*Audio) SetState ¶
func (w *Audio) SetState(s StateWidget)
func (*Audio) SetStateToPlay ¶
func (a *Audio) SetStateToPlay(s StateWidget)
type Color ¶
var ( ColorWhite = Color{ Red: 255, Green: 255, Blue: 255, Alpha: 255, } ColorBlack Color = Color{ Red: 0, Green: 0, Blue: 0, Alpha: 255, } ColorRed Color = Color{ Red: 255, Green: 0, Blue: 0, Alpha: 255, } ColorGreen Color = Color{ Red: 0, Green: 255, Blue: 0, Alpha: 255, } ColorBlue Color = Color{ Red: 0, Green: 0, Blue: 255, Alpha: 255, } ColorNoColor Color = Color{ Red: 0, Green: 0, Blue: 0, Alpha: 0, } )
Alpha 0: alpha disable Alpha 0: min oppacity Alpha 255: max oppacity
type Ellipse ¶
type Ellipse struct {
// contains filtered or unexported fields
}
func NewEllipse ¶
func (Ellipse) Color ¶
func (w Ellipse) Color(state StateWidget) Color
func (*Ellipse) KeyboardEvent ¶
func (w *Ellipse) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Ellipse) SetActionColor ¶
func (w *Ellipse) SetActionColor(c Color)
func (*Ellipse) SetHoverColor ¶
func (w *Ellipse) SetHoverColor(c Color)
func (*Ellipse) SetPosition ¶
func (*Ellipse) SetState ¶
func (w *Ellipse) SetState(s StateWidget)
func (*Ellipse) SetStyle ¶
func (e *Ellipse) SetStyle(s EllipseStyle)
type EllipseStyle ¶
type EllipseStyle uint8
const ( EllipseStyleFill EllipseStyle = iota EllipseStyleBorder )
type Input ¶
type Input struct { Text // contains filtered or unexported fields }
func (Input) Color ¶
func (w Input) Color(state StateWidget) Color
func (*Input) KeyboardEvent ¶
func (i *Input) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Input) SetActionColor ¶
func (w *Input) SetActionColor(c Color)
func (*Input) SetHoverColor ¶
func (w *Input) SetHoverColor(c Color)
func (*Input) SetPosition ¶
func (w *Input) SetPosition(x, y int32)
func (*Input) SetState ¶
func (w *Input) SetState(s StateWidget)
type Picture ¶
type Picture struct {
// contains filtered or unexported fields
}
func NewPicture ¶
func (Picture) Color ¶
func (w Picture) Color(state StateWidget) Color
func (*Picture) KeyboardEvent ¶
func (w *Picture) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Picture) SetActionColor ¶
func (w *Picture) SetActionColor(c Color)
func (*Picture) SetHeightRatioWidth ¶
func (*Picture) SetHoverColor ¶
func (w *Picture) SetHoverColor(c Color)
func (*Picture) SetPosition ¶
func (w *Picture) SetPosition(x, y int32)
func (*Picture) SetState ¶
func (w *Picture) SetState(s StateWidget)
func (*Picture) SetWidthRatioHeight ¶
type Rect ¶
type Rect struct {
// contains filtered or unexported fields
}
func (Rect) Color ¶
func (w Rect) Color(state StateWidget) Color
func (*Rect) KeyboardEvent ¶
func (w *Rect) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Rect) SetActionColor ¶
func (w *Rect) SetActionColor(c Color)
func (*Rect) SetHoverColor ¶
func (w *Rect) SetHoverColor(c Color)
func (*Rect) SetPosition ¶
func (w *Rect) SetPosition(x, y int32)
func (*Rect) SetState ¶
func (w *Rect) SetState(s StateWidget)
type StateWidget ¶
type StateWidget uint8
const ( StateBase StateWidget = iota StateHover StateAction StateOff )
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func (Text) Color ¶
func (w Text) Color(state StateWidget) Color
func (*Text) KeyboardEvent ¶
func (w *Text) KeyboardEvent(key *sdl.KeyboardEvent)
func (*Text) SetActionColor ¶
func (w *Text) SetActionColor(c Color)
func (*Text) SetHoverColor ¶
func (w *Text) SetHoverColor(c Color)
func (*Text) SetPosition ¶
func (w *Text) SetPosition(x, y int32)
func (*Text) SetState ¶
func (w *Text) SetState(s StateWidget)
type Widget ¶
type Widget interface { SetColor(c Color) SetHoverColor(c Color) SetActionColor(c Color) SetAction(Action) Color(StateWidget) Color Position() Position SetPosition(x, y int32) IsHover(x, y int32) bool SetState(s StateWidget) State() StateWidget SetSize(w, h int32) Click() Unfocus() KeyboardEvent(key *sdl.KeyboardEvent) Size() (int32, int32) Render(r *sdl.Renderer) error Close() }
Click to show internal directories.
Click to hide internal directories.