zntg/ui/label.go

20 lines
360 B
Go

package ui
import "opslag.de/schobers/galleg/allegro5"
type Label struct {
ControlBase
Text string
}
func (l *Label) Render(ctx Context) {
var fonts = ctx.Fonts()
var min = l.Bounds.Min.To32()
var fnt = fonts.Get("default")
fnt.Draw(min.X+leftMargin, min.Y+topMargin, ctx.Palette().Black(), allegro5.AlignLeft, l.Text)
l.ControlBase.Render(ctx)
}