summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2024-04-23 19:15:04 +0100
committerdavidovski <david@davidovski.xyz>2024-04-23 19:15:04 +0100
commit8042188030da951eb1e013bcffdc0a14f8f0fc0f (patch)
treeddac965c690c0ebe4039969ac75de470186ff4c2 /main.go
parenta77fc96b2e5f125d5bb0e920fe60d8111f9a2b69 (diff)
add custom font
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.go b/main.go
index c1a8922..31d2310 100644
--- a/main.go
+++ b/main.go
@@ -15,7 +15,6 @@ import (
"github.com/hajimehoshi/ebiten/v2/inpututil"
"github.com/hajimehoshi/ebiten/v2/vector"
"github.com/hajimehoshi/ebiten/v2/text/v2"
- "github.com/hajimehoshi/ebiten/v2/examples/resources/fonts"
"github.com/hajimehoshi/ebiten/v2/audio"
"github.com/hajimehoshi/ebiten/v2/audio/wav"
"github.com/hajimehoshi/ebiten/v2/audio/vorbis"
@@ -53,6 +52,9 @@ const (
)
var (
+ //go:embed assets/font.otf
+ fontOtf_src []byte
+
//go:embed shaders/none.kage
noneShader_src []byte
//go:embed shaders/vcr.kage
@@ -572,7 +574,7 @@ func (g *Game) DrawTitle(surface *ebiten.Image, alpha float32) {
textSize := 30.0
tmp := ebiten.NewImage(screenWidth, screenHeight)
- msg := fmt.Sprintf("LEVEL")
+ msg := fmt.Sprintf("LEVÅÆ")
textOp := &text.DrawOptions{}
textOp.GeoM.Translate((screenWidth - textSize*5 ) / 2, (screenHeight - textSize) / 3)
textOp.ColorScale.ScaleWithColor(color.RGBA{216, 211, 210, 255})
@@ -911,7 +913,7 @@ func (g *Game) LoadAudio() {
}
func (g *Game) LoadImages() {
- s, err := text.NewGoTextFaceSource(bytes.NewReader(fonts.PressStart2P_ttf))
+ s, err := text.NewGoTextFaceSource(bytes.NewReader(fontOtf_src))
if err != nil {
log.Fatal(err)
}