Documentation
¶
Index ¶
- func ClearAllAnimations()
- func Color(s string) color.Color
- func ColorCode(c color.Color) string
- func Draw(screen *ebiten.Image)
- func RegisterFont(fontType FontType, f *truetype.Font)
- func Update() error
- type Align
- type Animation
- type AnimationFunc
- type Box
- func (b *Box) Add(x, y int, child Element)
- func (b *Box) Clear()
- func (b *Box) Dirty()
- func (b *Box) Hide()
- func (b *Box) Id() int
- func (b *Box) IsVisible() bool
- func (b *Box) Move(x, y int)
- func (b *Box) Position() (x, y int)
- func (b *Box) Reflesh()
- func (b *Box) Resize(w, h int)
- func (b *Box) SetAnimation(a Animation)
- func (b *Box) SetBackgroundColor(c color.Color)
- func (b *Box) SetDrawImageOptions(op *ebiten.DrawImageOptions)
- func (b *Box) SetFocus()
- func (k Box) SetKeyCallback(key ebiten.Key, cb Callback)
- func (cs Box) SetMouseCallback(e MouseEvent, c Callback)
- func (b *Box) Show()
- func (b *Box) Size() (w, h int)
- func (b *Box) StopAnimation()
- func (b *Box) String() string
- type Callback
- type EasingFunc
- type Element
- type FontSize
- type FontType
- type Image
- type Imager
- type Label
- type MouseEvent
- type Ninepatch
- type RichLabel
- type Texter
- type VerticalAlign
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFont ¶
RegisterFont register font
Types ¶
type Animation ¶
type Animation struct {
IsLoop bool
Duration int
Delay int
Ease EasingFunc
OnStart AnimationFunc
OnAnime AnimationFunc
OnEnd AnimationFunc
}
Animation is animation
type AnimationFunc ¶
AnimationFunc is animate function for animation
type Box ¶
type Box struct {
Rect image.Rectangle
Color color.Color
Image *ebiten.Image
Parent Element
Children []Element
Self Element
// contains filtered or unexported fields
}
Box is simple box
func (*Box) SetBackgroundColor ¶
SetBackgroundColor set background color
func (*Box) SetDrawImageOptions ¶
func (b *Box) SetDrawImageOptions(op *ebiten.DrawImageOptions)
SetDrawImageOptions set DrawImageOptions
func (Box) SetKeyCallback ¶
SetKeyCallback set callback function for key. set nil means delete.
func (Box) SetMouseCallback ¶
func (cs Box) SetMouseCallback(e MouseEvent, c Callback)
SetMouseCallback set callback function to element. When set nil, it means delete
type EasingFunc ¶
EasingFunc is easing function for animation
type Element ¶
type Element interface {
Id() int
Show()
Hide()
IsVisible() bool
Reflesh()
Dirty()
Move(x, y int)
Position() (x, y int)
Resize(w, h int)
Size() (w, h int)
SetDrawImageOptions(op *ebiten.DrawImageOptions)
SetBackgroundColor(c color.Color)
SetAnimation(anime Animation)
StopAnimation()
Add(x, y int, el Element)
Clear()
SetMouseCallback(e MouseEvent, c Callback)
SetKeyCallback(key ebiten.Key, cb Callback)
SetFocus()
String() string
// contains filtered or unexported methods
}
Element is ebiten UI element
type Image ¶
Image is simple box
func (Image) SetKeyCallback ¶
SetKeyCallback set callback function for key. set nil means delete.
func (Image) SetMouseCallback ¶
func (cs Image) SetMouseCallback(e MouseEvent, c Callback)
SetMouseCallback set callback function to element. When set nil, it means delete
type Label ¶
type Label struct {
*Box
FontType
FontSize
FontColor color.Color
Align
// contains filtered or unexported fields
}
Label is simple box
func NewLabel ¶
func NewLabel(w, h int, text string, fontType FontType, fontSize FontSize, align Align, color, bgColor color.Color) *Label
NewLabel makes new *Label
func (Label) SetKeyCallback ¶
SetKeyCallback set callback function for key. set nil means delete.
func (Label) SetMouseCallback ¶
func (cs Label) SetMouseCallback(e MouseEvent, c Callback)
SetMouseCallback set callback function to element. When set nil, it means delete
type MouseEvent ¶
type MouseEvent int
MouseEvent is type of all UI event
const ( LeftDown MouseEvent = iota RightDown MiddleDown LeftUp RightUp MiddleUp LeftClick RightClick MiddleClick LeftDoubleClick RightDoubleClick MiddleDoubleClick MouseOn MouseOver MouseOut MouseIn MouseEnter MouseLeave )
mouseEvents
type Ninepatch ¶
Ninepatch is nine-patch image
func NewNinepatch ¶
NewNinepatch make new *ui.Ninepatch
func (Ninepatch) SetKeyCallback ¶
SetKeyCallback set callback function for key. set nil means delete.
func (Ninepatch) SetMouseCallback ¶
func (cs Ninepatch) SetMouseCallback(e MouseEvent, c Callback)
SetMouseCallback set callback function to element. When set nil, it means delete
type RichLabel ¶
type RichLabel struct {
*Label
LineHeight int
VerticalAlign
}
RichLabel is rich label
func NewRichLabel ¶
func NewRichLabel(w, h, lineHeight int, text string, fontType FontType, fontSize FontSize, align Align, valign VerticalAlign, color, bgColor color.Color) *RichLabel
NewRichLabel makes new *RichLabel
func (RichLabel) SetKeyCallback ¶
SetKeyCallback set callback function for key. set nil means delete.
func (RichLabel) SetMouseCallback ¶
func (cs RichLabel) SetMouseCallback(e MouseEvent, c Callback)
SetMouseCallback set callback function to element. When set nil, it means delete
type VerticalAlign ¶
type VerticalAlign int
VerticalAlign is Vertical Align
const ( Top VerticalAlign = iota Middle Bottom )
VerticalAlign