uibutton

package
v0.0.0-...-e7326f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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) GetID

func (b *UIButton) GetID() string

Implementation of the goi.Component

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

func (*UIButton) Update

func (b *UIButton) Update(gb interfaces.IGameBase) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL