ui

package
v0.0.0-...-f6fd52c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuffWidth          = 24
	BuffHeight         = 32
	BuffStackFontSize  = 13
	BuffStackTop       = 2
	BuffStackLeft      = 9
	BuffStackShadow    = 4
	BuffRemainTop      = -6
	BuffRemainFontSize = 12
)
View Source
const (
	InputHeight     = 28
	InputTextTop    = 8
	InputTextLeft   = 6
	InputTextHeight = 12
)
View Source
const (
	SingleBarMaxValue = 10000
	SingleBarWidth    = 150
	SingleBarHeight   = 13
	SingleBarPadding  = 13
)
View Source
const (
	PartyListWidth   = 300
	PartyListBGExtra = 20
)
View Source
const (
	PlayerItemHeight = 48
	StatusPartWidth  = 210
	JobIconSize      = 38

	HoverSpriteWidth  = 275
	HoverSpriteHeight = 40
	HoverSpriteTop    = 10
	HoverSpriteLeft   = 30

	CastNameTextSize = 12
	NameTextSize     = 13
	HMPTextSize      = 14

	CastBarWidth = 100
	BarHeight    = 12

	HPBarWidth   = 125
	MPBarWidth   = 75
	HMPBarHeight = 8

	BuffListOffsetY = 20
)
View Source
const (
	UIHalf    = 0.5
	UIPadding = 20
)

Variables

View Source
var (
	ResultColor = color.NRGBA{24, 169, 248, 128}
	PromptColor = color.NRGBA{255, 255, 255, 128}
	ErrorColor  = color.NRGBA{255, 0, 0, 128}
)
View Source
var PartyListBGNineSliceConfig = [4]int{5, 14, 0, 0}

Functions

func BuffListView

func BuffListView(buffs any) *furex.View

BuffListView is a view for displaying a list of buffs. You can provide a model.BuffList to update buffs dynamically, or just a list of model.Buff to display static buffs.

func BuffView

func BuffView(buff *model.Buff) *furex.View

func CheckBoxView

func CheckBoxView(size int, multiple bool, value *bool, label string, clickHandler func(bool)) *furex.View

func CommandView

func CommandView() *furex.View

func CreateEnemyBarView

func CreateEnemyBarView(i int, enemy *donburi.Entry) *furex.View

func DamageHistoryHeaderView

func DamageHistoryHeaderView() *furex.View

func DamageHistoryItemView

func DamageHistoryItemView(damage model.DamageTaken) *furex.View

func DamageHistoryView

func DamageHistoryView() *furex.View

func DrawText

func DrawText(
	screen *ebiten.Image,
	content string,
	fontSize float64,
	x, y float64,
	clr color.Color,
	align furex.FlexAlignItem,
	opt *ShadowOpt,
)

func EnemyBarsView

func EnemyBarsView() *furex.View

func HotBarView

func HotBarView(w, h int) *furex.View

func HotbarItemView

func HotbarItemView(item *HotBarItemConfig) *furex.View

func InitializeFont

func InitializeFont()

func InputView

func InputView(prefix string, minWidth int, commitHandler func(string)) *furex.View

func NewPartyList

func NewPartyList(players []*donburi.Entry) *furex.View

func NewPlayerItem

func NewPlayerItem(playerEntry *donburi.Entry) *furex.View

func ProgressBarView

func ProgressBarView() *furex.View

Types

type Bar

type Bar struct {
	Progress     any
	BG           *texture.NineSlice
	FG           *texture.NineSlice
	Segments     []float64
	Interactable bool
	ClickAt      func(c float64, p float64)
	// contains filtered or unexported fields
}

func (*Bar) Draw

func (b *Bar) Draw(screen *ebiten.Image, frame image.Rectangle, view *furex.View)

func (*Bar) HandleJustPressedMouseButtonLeft

func (b *Bar) HandleJustPressedMouseButtonLeft(frame image.Rectangle, x, y int) bool

func (*Bar) HandleJustReleasedMouseButtonLeft

func (b *Bar) HandleJustReleasedMouseButtonLeft(frame image.Rectangle, x, y int)

func (*Bar) HandleMouseEnter

func (b *Bar) HandleMouseEnter(x, y int) bool

func (*Bar) HandleMouseLeave

func (b *Bar) HandleMouseLeave()

func (*Bar) Handler

func (b *Bar) Handler() furex.ViewHandler

type BuffListHandler

type BuffListHandler struct {
	Buffs *model.BuffList
	// contains filtered or unexported fields
}

func (*BuffListHandler) Handler

func (bl *BuffListHandler) Handler() furex.ViewHandler

type CheckBoxHandler

type CheckBoxHandler struct {
	Size         int
	Checked      *bool
	ClickHandler func(bool)
	// contains filtered or unexported fields
}

func (*CheckBoxHandler) HandleJustPressedMouseButtonLeft

func (c *CheckBoxHandler) HandleJustPressedMouseButtonLeft(frame image.Rectangle, x, y int) bool

func (*CheckBoxHandler) HandleJustReleasedMouseButtonLeft

func (c *CheckBoxHandler) HandleJustReleasedMouseButtonLeft(frame image.Rectangle, x, y int)

func (*CheckBoxHandler) Handler

func (c *CheckBoxHandler) Handler() furex.ViewHandler

func (*CheckBoxHandler) Update

func (c *CheckBoxHandler) Update(v *furex.View)

type CommandHandler

type CommandHandler struct {
	// contains filtered or unexported fields
}

func (*CommandHandler) AddEcho

func (c *CommandHandler) AddEcho(cmd string)

func (*CommandHandler) AddError

func (c *CommandHandler) AddError(err string)

func (*CommandHandler) AddPrompt

func (c *CommandHandler) AddPrompt(prompt string)

func (*CommandHandler) AddResult

func (c *CommandHandler) AddResult(result string)

func (*CommandHandler) CommitCommand

func (c *CommandHandler) CommitCommand(cmd string)

func (*CommandHandler) Execute

func (c *CommandHandler) Execute(cmd string)

type FFUI

type FFUI struct {
	// contains filtered or unexported fields
}

func NewReplayUI

func NewReplayUI(ecs *ecs.ECS) *FFUI

func (*FFUI) Draw

func (f *FFUI) Draw(screen *ebiten.Image)

func (*FFUI) Update

func (f *FFUI) Update(w, h int)

type Focusable

type Focusable interface {
	SetFocus(focused bool)
}

type HotBarItemConfig

type HotBarItemConfig struct {
	Name         string
	Icon         *ebiten.Image
	ClickHandler func()
	// contains filtered or unexported fields
}

type InputHandler

type InputHandler struct {
	View     *furex.View
	MinWidth int

	CommitHandler func(string)
	// contains filtered or unexported fields
}

func (*InputHandler) Content

func (i *InputHandler) Content() string

func (*InputHandler) HandleJustPressedMouseButtonLeft

func (i *InputHandler) HandleJustPressedMouseButtonLeft(frame image.Rectangle, x int, y int) bool

HandleJustPressedMouseButtonLeft implements furex.MouseLeftButtonHandler.

func (*InputHandler) HandleJustReleasedMouseButtonLeft

func (i *InputHandler) HandleJustReleasedMouseButtonLeft(frame image.Rectangle, x int, y int)

HandleJustReleasedMouseButtonLeft implements furex.MouseLeftButtonHandler.

func (*InputHandler) HandleMouseEnter

func (i *InputHandler) HandleMouseEnter(x int, y int) bool

HandleMouseEnter implements furex.MouseEnterLeaveHandler.

func (*InputHandler) HandleMouseLeave

func (i *InputHandler) HandleMouseLeave()

HandleMouseLeave implements furex.MouseEnterLeaveHandler.

func (*InputHandler) Handler

func (i *InputHandler) Handler() furex.ViewHandler

func (*InputHandler) SetFocus

func (i *InputHandler) SetFocus(b bool)

SetFocus implements Focusable.

func (*InputHandler) Update

func (i *InputHandler) Update(v *furex.View)

type LimitBreak

type LimitBreak struct {
	Value     *int
	BarNumber *int
	// contains filtered or unexported fields
}

func (*LimitBreak) Handler

func (l *LimitBreak) Handler() furex.ViewHandler

func (*LimitBreak) RenderLimitbreakSingleBar

func (l *LimitBreak) RenderLimitbreakSingleBar(canvas *ebiten.Image, x, y float64, value int)

type PlayerCommand

type PlayerCommand struct {
	// contains filtered or unexported fields
}

type PlayerItem

type PlayerItem struct {
	Player   *donburi.Entry
	Hovered  bool
	Selected bool
	// contains filtered or unexported fields
}

func (*PlayerItem) HandleJustPressedMouseButtonLeft

func (p *PlayerItem) HandleJustPressedMouseButtonLeft(_ image.Rectangle, x, y int) bool

func (*PlayerItem) HandleJustReleasedMouseButtonLeft

func (p *PlayerItem) HandleJustReleasedMouseButtonLeft(_ image.Rectangle, x, y int)

func (*PlayerItem) HandleMouseEnter

func (p *PlayerItem) HandleMouseEnter(x, y int) bool

func (*PlayerItem) HandleMouseLeave

func (p *PlayerItem) HandleMouseLeave()

func (*PlayerItem) Handler

func (p *PlayerItem) Handler() furex.ViewHandler

func (*PlayerItem) Update

func (p *PlayerItem) Update(v *furex.View)

type PlaygroundUI

type PlaygroundUI struct {
	// contains filtered or unexported fields
}

func NewPlaygroundUI

func NewPlaygroundUI(ecs *ecs.ECS) *PlaygroundUI

func (*PlaygroundUI) Draw

func (p *PlaygroundUI) Draw(screen *ebiten.Image)

func (*PlaygroundUI) SetupHotBar

func (p *PlaygroundUI) SetupHotBar(v *furex.View, w, h int)

func (*PlaygroundUI) Update

func (p *PlaygroundUI) Update(w, h int)

type ShadowOpt

type ShadowOpt struct {
	Color  color.Color
	Offset float64
}

type Sprite

type Sprite struct {
	NineSliceTexture *texture.NineSlice
	Texture          *ebiten.Image
	BlendAlpha       bool
	Alpha            float32
	// contains filtered or unexported fields
}

func (*Sprite) Handler

func (s *Sprite) Handler() furex.ViewHandler

type Text

type Text struct {
	Align        furex.FlexAlignItem
	Content      any
	Color        color.Color
	Shadow       bool
	ShadowOffset float64
	ShadowColor  color.Color
	// contains filtered or unexported fields
}

Content must be string or func() string.

func (*Text) Handler

func (t *Text) Handler() furex.ViewHandler

func (*Text) Measure

func (t *Text) Measure(fontSize float64) (float64, float64)

type UI

type UI interface {
	Update(w int, h int)
	Draw(screen *ebiten.Image)
}

Jump to

Keyboard shortcuts

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