Documentation ¶
Index ¶
- type Element
- func (e *Element) Draw(dst *ebiten.Image)
- func (e *Element) Height() int
- func (e *Element) IsDestroyed() bool
- func (e *Element) IsEnabled() bool
- func (e *Element) IsVisible() bool
- func (e *Element) LerpPosition(endPositionX, endPositionY float64, duration time.Duration, isDestroyed bool, ...)
- func (e *Element) Name() string
- func (e *Element) Position() (float64, float64)
- func (e *Element) RenderIndex() int64
- func (e *Element) SetColor(fill color.Color)
- func (e *Element) SetEnabled(isEnabled bool)
- func (e *Element) SetHeight(height int)
- func (e *Element) SetIsDestroyed(isDestroyed bool)
- func (e *Element) SetOnPressFunction(f func())
- func (e *Element) SetOnPressed(f func(e *Element))
- func (e *Element) SetPosition(x float64, y float64)
- func (e *Element) SetRenderIndex(renderIndex int64)
- func (e *Element) SetScale(scale float64)
- func (e *Element) SetText(text string)
- func (e *Element) SetValue(value float64)
- func (e *Element) SetVisible(isVisible bool)
- func (e *Element) SetWidth(width int)
- func (e *Element) Update(dt float64)
- func (e *Element) Value() float64
- func (e *Element) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element represents a UI clickable 9slice button. A element has text A element can register events on click
func New ¶
func New(name string, scene string, text string, x float64, y float64, width int, height int, font *common.Font, textColor color.Color, img *common.Image, borderSliceName string, fillSliceName string) (*Element, error)
New creates a new button instance
func (*Element) IsDestroyed ¶
IsDestroyed returns true when the element is flagged for deletion
func (*Element) LerpPosition ¶
func (e *Element) LerpPosition(endPositionX, endPositionY float64, duration time.Duration, isDestroyed bool, endFunc func())
LerpPosition changes an element's position over duration
func (*Element) RenderIndex ¶
RenderIndex returns the render index of element
func (*Element) SetEnabled ¶
SetEnabled changes if a element is enabled
func (*Element) SetIsDestroyed ¶
SetIsDestroyed sets an element to be destroyed on next update
func (*Element) SetOnPressFunction ¶
func (e *Element) SetOnPressFunction(f func())
SetOnPressFunction lets you pass a function without the need of element handling
func (*Element) SetOnPressed ¶
SetOnPressed sets a element state
func (*Element) SetPosition ¶
SetPosition sets an element's position
func (*Element) SetRenderIndex ¶
SetRenderIndex sets the render index of element
func (*Element) SetVisible ¶
SetVisible changes the visibility of a element