Added header font.
This commit is contained in:
parent
8d7ec272b6
commit
aa47e2cabb
@ -180,6 +180,7 @@ type settingsHeader struct {
|
||||
|
||||
func newSettingsHeader(label string) alui.Control {
|
||||
header := &settingsHeader{}
|
||||
header.Font = "header"
|
||||
header.Text = label
|
||||
return alui.NewMargins(header, 3*margin, 0, 2*margin, 0)
|
||||
}
|
||||
|
@ -61,7 +61,11 @@ func (g *game) loadBitmap(path, name string) error {
|
||||
}
|
||||
|
||||
func (g *game) loadFonts() error {
|
||||
openSansPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Regular.ttf")
|
||||
openSansRegularPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Regular.ttf")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
openSansBoldPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Bold.ttf")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -69,7 +73,11 @@ func (g *game) loadFonts() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansPath, Name: "default", Size: 32})
|
||||
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansRegularPath, Name: "default", Size: 32})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansBoldPath, Name: "header", Size: 32})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
BIN
cmd/krampus19/res/fonts/OpenSans-Bold.ttf
Normal file
BIN
cmd/krampus19/res/fonts/OpenSans-Bold.ttf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user