progress

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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

func (e *Element) Draw(dst *ebiten.Image)

Draw is called during a game update

func (*Element) Height

func (e *Element) Height() int

Height returns an element's height

func (*Element) IsDestroyed

func (e *Element) IsDestroyed() bool

IsDestroyed returns true when the element is flagged for deletion

func (*Element) IsEnabled

func (e *Element) IsEnabled() bool

IsEnabled returns true if a element is enabled

func (*Element) IsVisible

func (e *Element) IsVisible() bool

IsVisible returns true if mob is visible

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

func (e *Element) Name() string

Name returns a mob's name

func (*Element) Position

func (e *Element) Position() (float64, float64)

Position returns an element's position

func (*Element) RenderIndex

func (e *Element) RenderIndex() int64

RenderIndex returns the render index of element

func (*Element) SetColor

func (e *Element) SetColor(fill color.Color)

SetColor sets the text color

func (*Element) SetEnabled

func (e *Element) SetEnabled(isEnabled bool)

SetEnabled changes if a element is enabled

func (*Element) SetHeight

func (e *Element) SetHeight(height int)

SetHeight sets an element's height

func (*Element) SetIsDestroyed

func (e *Element) SetIsDestroyed(isDestroyed bool)

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

func (e *Element) SetOnPressed(f func(e *Element))

SetOnPressed sets a element state

func (*Element) SetPosition

func (e *Element) SetPosition(x float64, y float64)

SetPosition sets an element's position

func (*Element) SetRenderIndex

func (e *Element) SetRenderIndex(renderIndex int64)

SetRenderIndex sets the render index of element

func (*Element) SetScale

func (e *Element) SetScale(scale float64)

SetScale sets an element's scale

func (*Element) SetText

func (e *Element) SetText(text string)

SetText changes the text on the element

func (*Element) SetValue

func (e *Element) SetValue(value float64)

SetValue sets the percent of value, ceil(1), floor(0)

func (*Element) SetVisible

func (e *Element) SetVisible(isVisible bool)

SetVisible changes the visibility of a element

func (*Element) SetWidth

func (e *Element) SetWidth(width int)

SetWidth sets an element's width

func (*Element) Update

func (e *Element) Update(dt float64)

Update is called during a game update

func (*Element) Value

func (e *Element) Value() float64

Value returs the percent of fill a progress is at

func (*Element) Width

func (e *Element) Width() int

Width returns an element's width

Jump to

Keyboard shortcuts

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