dialog skeleton
This commit is contained in:
@@ -6,9 +6,13 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
||||
"image/color"
|
||||
_ "image/png"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/examples/resources/fonts"
|
||||
"golang.org/x/image/font"
|
||||
"golang.org/x/image/font/opentype"
|
||||
)
|
||||
|
||||
func LoadImage(path string) *ebiten.Image {
|
||||
@@ -30,3 +34,20 @@ func LoadImage(path string) *ebiten.Image {
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
type FontLayout struct {
|
||||
DPI float64
|
||||
Size float64
|
||||
Color color.Color
|
||||
SelectedColor color.Color
|
||||
}
|
||||
|
||||
func GetFontFace(layout FontLayout) font.Face {
|
||||
tt, _ := opentype.Parse(fonts.MPlus1pRegular_ttf)
|
||||
face, _ := opentype.NewFace(tt, &opentype.FaceOptions{
|
||||
Size: layout.DPI,
|
||||
DPI: layout.Size,
|
||||
Hinting: font.HintingVertical,
|
||||
})
|
||||
return face
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user