2018-08-03 06:46:10 +00:00
|
|
|
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")
|
2018-08-07 05:03:52 +00:00
|
|
|
fnt.Draw(min.X+leftMargin, min.Y+lineHeight-fnt.Ascent(), ctx.Palette().Darkest(), allegro5.AlignLeft, l.Text)
|
2018-08-03 06:46:10 +00:00
|
|
|
|
|
|
|
l.ControlBase.Render(ctx)
|
|
|
|
}
|