zntg/ui/label.go
Sander Schobers 239c24533d Some changes to UI elements.
- Added colors to palette and renamed white/black to lightest/darkest.
- Extracted drawing code.
- Restyled checkbox, spinner and scrollbar.
2018-08-07 10:13:05 +02:00

20 lines
376 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+lineHeight-fnt.Ascent(), ctx.Palette().Darkest(), allegro5.AlignLeft, l.Text)
l.ControlBase.Render(ctx)
}