Documentation
¶
Index ¶
- Variables
- func ActiveUI(ui IUIPanel)
- func CloseUI(ui IUIPanel)
- func Draw(screen *ebiten.Image)
- func Focused() bool
- func GetDefaultUIFont() font.Face
- func GetDefaultUIImage() *ebiten.Image
- func IsFrameClick() bool
- func IsFrameHover() bool
- func MakeOptionBoxGroup(a ...*OptionBox) map[*OptionBox]struct{}
- func OnLayout(w, h int)
- func SetBorderDebug(v bool)
- func SetDefaultUIFont(f font.Face)
- func SetDefaultUIImage(img *ebiten.Image)
- func SetFrameClick()
- func SetFrameHover()
- func Update()
- type BaseUI
- func (u *BaseUI) AddChildren(cs ...IUIPanel)
- func (u *BaseUI) Draw(screen *ebiten.Image)
- func (u *BaseUI) Focused() bool
- func (u *BaseUI) GetBDColor() color.Color
- func (u *BaseUI) GetDepth() int
- func (u *BaseUI) GetImage() *ebiten.Image
- func (u *BaseUI) GetParent() IUIPanel
- func (u *BaseUI) GetWH() (int, int)
- func (u *BaseUI) GetWorldXY() (int, int)
- func (u *BaseUI) GetXY() (int, int)
- func (u *BaseUI) IsDisabled() bool
- func (u *BaseUI) IsVisible() bool
- func (u *BaseUI) OnClose()
- func (u *BaseUI) OnLayout(w, h int)
- func (u *BaseUI) RemoveChild(c IUIPanel)
- func (u *BaseUI) SetFocused(focused bool)
- func (u *BaseUI) SetOnHout(f func())
- func (u *BaseUI) SetOnHover(f func())
- func (u *BaseUI) SetParent(p IUIPanel)
- func (u *BaseUI) Update()
- type Button
- type CheckBox
- type Dragger
- type HScrollBar
- type IUIPanel
- type InputBox
- type OptionBox
- type Panel
- type TextBox
- type VScrollBar
Constants ¶
This section is empty.
Variables ¶
View Source
var FS embed.FS
Functions ¶
func GetDefaultUIFont ¶
func GetDefaultUIImage ¶
func GetDefaultUIImage() *ebiten.Image
func IsFrameClick ¶
func IsFrameClick() bool
func IsFrameHover ¶
func IsFrameHover() bool
func MakeOptionBoxGroup ¶
func SetBorderDebug ¶
func SetBorderDebug(v bool)
func SetDefaultUIFont ¶
func SetDefaultUIImage ¶
func SetDefaultUIImage(img *ebiten.Image)
func SetFrameClick ¶
func SetFrameClick()
func SetFrameHover ¶
func SetFrameHover()
Types ¶
type BaseUI ¶
type BaseUI struct {
X, Y, W, H int
Depth int //update draw depth
Visible bool //`default:"true"` disable draw
Disabled bool //disable update
EnableFocus bool //enable focus
BGColor color.Color
BDColor color.Color
Image *ebiten.Image
DrawOp ebiten.DrawImageOptions
// contains filtered or unexported fields
}
func (*BaseUI) AddChildren ¶
func (*BaseUI) GetBDColor ¶
func (*BaseUI) IsDisabled ¶
func (*BaseUI) RemoveChild ¶
func (*BaseUI) SetFocused ¶
func (*BaseUI) SetOnHover ¶
func (u *BaseUI) SetOnHover(f func())
type Button ¶
type Button struct { BaseUI Text string AutoSizeByText bool TextColor color.Color UIImage *ebiten.Image ImageRect image.Rectangle ImageRectPressed image.Rectangle // contains filtered or unexported fields }
func NewTextButton ¶
NewTextButton 按text长度自动调整大小无背景UI
func (*Button) SetOnClick ¶
func (b *Button) SetOnClick(f func())
type CheckBox ¶
type CheckBox struct { BaseUI Text string UIImage *ebiten.Image ImageRect image.Rectangle ImageRectPressed image.Rectangle ImageRectMark image.Rectangle // contains filtered or unexported fields }
func NewCheckBox ¶
func (*CheckBox) SetChecked ¶
func (*CheckBox) SetOnCheckChanged ¶
type HScrollBar ¶
type HScrollBar struct { BaseUI UIImage *ebiten.Image ImageRectBack image.Rectangle ImageRectFront image.Rectangle // contains filtered or unexported fields }
HScrollBar 横向ScrollBar
func NewHScrollBar ¶
func NewHScrollBar() *HScrollBar
func (*HScrollBar) ContentOffset ¶
func (v *HScrollBar) ContentOffset() int
func (*HScrollBar) Draw ¶
func (v *HScrollBar) Draw(dst *ebiten.Image)
func (*HScrollBar) Update ¶
func (v *HScrollBar) Update(wx, wy, contentWidth int)
type InputBox ¶
type InputBox struct { BaseUI DefaultText string //无Text时默认灰文本 MaxChars int //最大长度 PasswordChar string //密文显示 Editable bool Selectable bool UIImage *ebiten.Image ImageRect image.Rectangle // contains filtered or unexported fields }
func NewInputBox ¶
func (*InputBox) AppendTextHistory ¶
func (*InputBox) SetOnPressEnter ¶
type OptionBox ¶
type OptionBox struct { BaseUI Text string UIImage *ebiten.Image ImageRect image.Rectangle ImageRectPressed image.Rectangle ImageRectMark image.Rectangle // contains filtered or unexported fields }
func NewOptionBox ¶
func (*OptionBox) Add2OptionBoxGroup ¶
func (*OptionBox) SetOnSelect ¶
type TextBox ¶
type TextBox struct { BaseUI Text string TextColor color.Color DisableVScroll bool DisableHScroll bool UIImage *ebiten.Image ImageRect image.Rectangle // contains filtered or unexported fields }
func NewTextBox ¶
func (*TextBox) AppendLine ¶
func (*TextBox) ContentSize ¶
type VScrollBar ¶
type VScrollBar struct { BaseUI UIImage *ebiten.Image ImageRectBack image.Rectangle ImageRectFront image.Rectangle // contains filtered or unexported fields }
VScrollBar 竖向ScrollBar
func NewVScrollBar ¶
func NewVScrollBar() *VScrollBar
func (*VScrollBar) ContentOffset ¶
func (v *VScrollBar) ContentOffset() int
func (*VScrollBar) Draw ¶
func (v *VScrollBar) Draw(dst *ebiten.Image)
func (*VScrollBar) Update ¶
func (v *VScrollBar) Update(wx, wy, contentHeight int)
Click to show internal directories.
Click to hide internal directories.