Documentation ¶
Index ¶
- type UIButton
- func (b *UIButton) ExitClick(exitClickF interfaces.UIButtonClickF)
- func (b *UIButton) ExitHover(exitHover interfaces.UIButtonHoverF)
- func (b *UIButton) GetID() string
- func (b *UIButton) OnClick(onClickF interfaces.UIButtonClickF)
- func (b *UIButton) OnHover(onHover interfaces.UIButtonHoverF)
- func (b *UIButton) Update(gb interfaces.IGameBase) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UIButton ¶
type UIButton struct {
// contains filtered or unexported fields
}
Represents simple button that can handle hovering and clicks. But keep in mind, that the event fuctions can be called many times with different mouse buttons.
func New ¶
func New(sprite interfaces.ISprite, uicolliders []interfaces.IUICollider) *UIButton
func (*UIButton) ExitClick ¶
func (b *UIButton) ExitClick(exitClickF interfaces.UIButtonClickF)
When mouse button is released, this function-handler will be called. Know that here can be only one handler.
* NOTE: function-handler can be called multiply times because of clicking different mouse buttons (left, right, center, etc.)
Function must have this type:
func(e interfaces.UIButtonClickEvent) error
func (*UIButton) ExitHover ¶
func (b *UIButton) ExitHover(exitHover interfaces.UIButtonHoverF)
When the cursor exits from the borders of the button then function-handler will be called. Know that here can be only one handler.
Function must have this type:
func(e UIButtonHoverEvent) error
func (*UIButton) OnClick ¶
func (b *UIButton) OnClick(onClickF interfaces.UIButtonClickF)
Given function will be called when button is clicked. Know that here can be only one handler.
* NOTE: function-handler can be called multiply times because of clicking different mouse buttons (left, right, center, etc.)
Function must have this type:
func(e interfaces.UIButtonClickEvent) error
func (*UIButton) OnHover ¶
func (b *UIButton) OnHover(onHover interfaces.UIButtonHoverF)
When the cursor will be hovered on the button, i.e. will enter into the borders of the button then the function-handler will be called. Know that here can be only one handler.
Function must have this type:
func(e UIButtonHoverEvent) error