func (e *Element) SetHeight(height int) {
	e.height = height
}
SetHeight sets an element's height
package button
import (
	"image/color"
	"time"
	"github.com/hajimehoshi/ebiten"
	"github.com/hajimehoshi/ebiten/inpututil"
	"github.com/hajimehoshi/ebiten/text"
	"github.com/xackery/egui/common"
)
type Element struct {
	name               string
	image              *common.Image
	x                  float64
	y                  float64
	scale              float64
	width              int
	height             int
	text               string
	isEnabled          bool
	isVisible          bool
	isPressed          bool
	onPressed          func(e *Element)
	onPressFunction    func()
	renderIndex        int64
	isDestroyed        bool
	lerpPosition       *common.LerpPosition
	lerpColor          *common.LerpColor
	color              color.Color
	font               *common.Font
	pressedSliceName   string
	unpressedSliceName string
}
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, pressedSliceName string, unpressedSliceName string) (*Element, error) {
	e := &Element{
		name:               name,
		image:              img,
		text:               text,
		isEnabled:          true,
		isVisible:          true,
		lerpPosition:       new(common.LerpPosition),
		lerpColor:          new(common.LerpColor),
		color:              textColor,
		x:                  x,
		y:                  y,
		width:              width,
		height:             height,
		font:               font,
		pressedSliceName:   pressedSliceName,
		unpressedSliceName: unpressedSliceName,
		scale:              1,
	}
	return e, nil
}
func (e *Element) Name() string {
	return e.name
}
func (e *Element) IsVisible() bool {
	return e.isVisible
}
func (e *Element) IsEnabled() bool {
	return e.isEnabled
}
func (e *Element) SetEnabled(isEnabled bool) {
	e.isEnabled = isEnabled
}
func (e *Element) SetVisible(isVisible bool) {
	e.isVisible = isVisible
}
func (e *Element) RenderIndex() int64 {
	return e.renderIndex
}
func (e *Element) SetRenderIndex(renderIndex int64) {
	e.renderIndex = renderIndex
}
func (e *Element) Update(dt float64) {
	if e.lerpPosition.IsEnabled() {
		e.x, e.y = e.lerpPosition.Lerp()
		if !e.lerpPosition.IsEnabled() {
			if e.lerpPosition.EndFunc() != nil {
				e.lerpPosition.EndFunc()
			}
			if e.lerpPosition.IsDestroyed() {
				e.isDestroyed = true
				return
			}
		}
	}
	isRecentlyPressed := false
	for _, t := range inpututil.JustPressedTouchIDs() {
		x, y := ebiten.TouchPosition(t)
		fx := float64(x)
		fy := float64(y)
		if e.x <= fx && fx < e.x+float64(e.width) && e.y <= fy && fy < e.y+float64(e.height) {
			e.isPressed = true
			isRecentlyPressed = true
		} else {
			e.isPressed = false
		}
	}
	if ebiten.IsMouseButtonPressed(ebiten.MouseButtonLeft) {
		x, y := ebiten.CursorPosition()
		fx := float64(x)
		fy := float64(y)
		if e.x <= fx && fx < e.x+float64(e.width) && e.y <= fy && fy < e.y+float64(e.height) {
			e.isPressed = true
			isRecentlyPressed = true
		} else {
			e.isPressed = false
		}
	}
	if !isRecentlyPressed && e.isPressed {
		if e.onPressed != nil {
			e.onPressed(e)
		}
		if e.onPressFunction != nil {
			e.onPressFunction()
		}
		e.isPressed = false
	}
}
func (e *Element) Draw(dst *ebiten.Image) {
	if !e.isVisible {
		return
	}
	sliceName := e.unpressedSliceName
	if e.isPressed {
		sliceName = e.pressedSliceName
	}
	slice, err := e.image.Slice(sliceName)
	if err != nil {
		return
	}
	op := &ebiten.DrawImageOptions{}
	op.GeoM.Translate(e.x, e.y)
	op.GeoM.Scale(e.scale, e.scale)
	if !e.isEnabled {
		op.ColorM.ChangeHSV(0, 0, 1)
		op.ColorM.Scale(0.5, 0.5, 0.5, 1)
	}
	common.DrawNineSlicing(dst, e.image.EbitenImage, slice.Keys[0], e.width, int(e.height), &op.GeoM, &op.ColorM)
	text.Draw(dst, e.text, e.font.Face, int(e.x), int(e.y), e.color)
}
func (e *Element) SetText(text string) {
	e.text = text
}
func (e *Element) SetOnPressed(f func(e *Element)) {
	e.onPressed = f
}
func (e *Element) SetOnPressFunction(f func()) {
	e.onPressFunction = f
}
func (e *Element) IsDestroyed() bool {
	return e.isDestroyed
}
func (e *Element) LerpPosition(endPosition common.Vector, duration time.Duration, isDestroyed bool, endFunc func()) {
	e.lerpPosition.Init(time.Now(), &common.Vector{X: e.x, Y: e.y}, &common.Vector{X: endPosition.X, Y: endPosition.Y}, duration, true, endFunc, isDestroyed)
}
func (e *Element) Position() (float64, float64) {
	return e.x, e.y
}
func (e *Element) SetPosition(x float64, y float64) {
	e.x = x
	e.y = y
}
func (e *Element) Width() int {
	return e.width
}
func (e *Element) SetWidth(width int) {
	e.width = width
}
func (e *Element) Height() int {
	return e.height
}