Checkpoint
This commit is contained in:
138 files changed
+1898
-57607
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package display
|
||||
|
||||
import (
|
||||
"image"
|
||||
"image/draw"
|
||||
|
||||
"go.maze.io/harmon/internal/pixel"
|
||||
"golang.org/x/image/font"
|
||||
"golang.org/x/image/font/basicfont"
|
||||
"golang.org/x/image/math/fixed"
|
||||
)
|
||||
|
||||
func DrawText(d draw.Image, x, y int, text string) {
|
||||
var (
|
||||
point = fixed.Point26_6{fixed.Int26_6(x * 64), fixed.Int26_6(y * 64)}
|
||||
drawer = &font.Drawer{
|
||||
Dst: d,
|
||||
Src: &image.Uniform{pixel.On},
|
||||
Face: basicfont.Face7x13,
|
||||
Dot: point,
|
||||
}
|
||||
)
|
||||
drawer.DrawString(text)
|
||||
}
|
||||
Reference in new issue
Block a user