text

package
v0.99.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDialog = &DialogManager{
	ShowAllChecker: defaultShowAll,
	AdvanceChecker: defaultAdvance,
}

Functions

This section is empty.

Types

type CommandType

type CommandType int
const (
	CmdChar CommandType = iota
	CmdEnd
	CmdEndNoWait
)

type DialogManager

type DialogManager struct {
	ShowAllChecker func() bool
	AdvanceChecker func() bool
	SoundPlayer    *sound.SoundPlayer
	// contains filtered or unexported fields
}

func (*DialogManager) Active

func (dm *DialogManager) Active() bool

func (*DialogManager) RevealedAll

func (dm *DialogManager) RevealedAll() bool

func (*DialogManager) Show

func (dm *DialogManager) Show(text string, style TextStyle, charSound string)

func (*DialogManager) Update

func (dm *DialogManager) Update(dt time.Duration)

func (*DialogManager) Waiting

func (dm *DialogManager) Waiting() bool

type DialogueCommand

type DialogueCommand struct {
	Type      CommandType
	Char      string
	Color     color.Color
	X         float64
	Y         float64
	TriggerAt float64
}

type Glyph

type Glyph struct {
	Image  *ebiten.Image
	PosX   float64
	PosY   float64
	ScaleX float64
	ScaleY float64
	Tilt   float64
	Color  color.Color
}

func (*Glyph) Draw

func (g *Glyph) Draw(s *ebiten.Image)

type TextDisplay

type TextDisplay struct {
	Commands   []DialogueCommand
	CmdIndex   int
	Displayed  []*Glyph
	IsComplete bool
	OnComplete func()
	CharSound  string
	// contains filtered or unexported fields
}

func NewTextDisplay

func NewTextDisplay(text string, style TextStyle) *TextDisplay

func (*TextDisplay) Advance

func (t *TextDisplay) Advance() bool

func (*TextDisplay) Destroy

func (t *TextDisplay) Destroy()

func (*TextDisplay) Draw

func (t *TextDisplay) Draw(s *ebiten.Image)

func (*TextDisplay) RevealedAll

func (t *TextDisplay) RevealedAll() bool

func (*TextDisplay) ShowAll

func (t *TextDisplay) ShowAll()

func (*TextDisplay) Update

func (t *TextDisplay) Update(deltaTime time.Duration)

func (*TextDisplay) Waiting

func (t *TextDisplay) Waiting() bool

type TextParser

type TextParser struct {
	Text         string
	StartX       float64
	StartY       float64
	ScaleX       float64
	ScaleY       float64
	FontHeight   float64
	LineSpacing  float64
	Delay        float64
	CharWidth    map[string]int
	CharSpacing  float64
	DefaultColor color.Color
}

func (*TextParser) Parse

func (p *TextParser) Parse() []DialogueCommand

type TextString

type TextString struct {
	X, Y       float64
	Rotation   float64
	Alpha      float64
	Text       string
	Style      TextStyle
	Layer      int
	Visible    bool
	Centered   bool
	UpdateFunc func(ts *TextString, dt time.Duration)
	// contains filtered or unexported fields
}

func NewTextString

func NewTextString(text string, x, y float64, style TextStyle) *TextString

func (*TextString) Destroy

func (ts *TextString) Destroy()

func (*TextString) Draw

func (ts *TextString) Draw(screen *ebiten.Image)

func (*TextString) Hide

func (ts *TextString) Hide()

func (*TextString) SetPosition

func (ts *TextString) SetPosition(x, y float64)

func (*TextString) SetText

func (ts *TextString) SetText(text string)

func (*TextString) Show

func (ts *TextString) Show()

func (*TextString) Update

func (ts *TextString) Update(deltaTime time.Duration)

type TextStyle

type TextStyle struct {
	FontName     string
	StartX       float64
	StartY       float64
	ScaleX       float64
	ScaleY       float64
	FontHeight   float64
	LineSpacing  float64
	DefaultDelay float64
	Instant      bool
	CharSpacing  float64
	Color        color.Color
}

func (TextStyle) WithInstant

func (s TextStyle) WithInstant(instant bool) TextStyle

Jump to

Keyboard shortcuts

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