Files
osui-go/ui/text.go
T
2024-10-12 17:49:55 +02:00

27 lines
455 B
Go

package ui
import (
"github.com/orus-dev/osui"
)
type TextComponent struct {
Data osui.ComponentData
Text string
}
func (t *TextComponent) Update(string) bool {
return false
}
func (t *TextComponent) GetComponentData() *osui.ComponentData {
return &t.Data
}
func (t TextComponent) Render() string {
return t.Text
}
func Text(param osui.Param, text string) *TextComponent {
return param.UseParam(&TextComponent{Text: text}).(*TextComponent)
}