Documentation ¶
Index ¶
- type Element
- func (e *Element) AnimationName() string
- func (e *Element) BundleIndex() int
- func (e *Element) CellHeight() int
- func (e *Element) CellWidth() int
- func (e *Element) Draw(screen *ebiten.Image)
- func (e *Element) Height() int
- func (e *Element) IsAnimated() bool
- 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) RenderIndex() int64
- func (e *Element) Scale() float64
- func (e *Element) SetAnimation(anim common.Animation) error
- func (e *Element) SetAnimationName(name string)
- func (e *Element) SetBundleIndex(index int) error
- func (e *Element) SetEnabled(isEnabled bool)
- func (e *Element) SetHeight(height int)
- func (e *Element) SetIsAnimated(isAnimated bool)
- 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) SetVisible(isVisible bool)
- func (e *Element) SetWidth(width int)
- func (e *Element) Update(dt 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 Element element. It contains animation data
func New ¶
func New(name string, scene string, x float64, y float64, width int, height int, tintColor color.Color, img *common.Image) (*Element, error)
New creates a new element
func (*Element) AnimationName ¶
AnimationName returns the current played animation name
func (*Element) BundleIndex ¶
BundleIndex returns the index sprite rendering
func (*Element) CellHeight ¶
CellHeight returns an element's animation cell height
func (*Element) IsAnimated ¶
IsAnimated returns true if the element is considered an animation
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) SetAnimation ¶
SetAnimation sets animation data
func (*Element) SetAnimationName ¶
SetAnimationName sets the current animation group name
func (*Element) SetBundleIndex ¶
SetBundleIndex sets which version of sprite bundle to render
func (*Element) SetEnabled ¶
SetEnabled changes if a element is enabled
func (*Element) SetIsAnimated ¶
SetIsAnimated flags if the animation information should be honored or not
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