text: Swap arguments face and text

This commit is contained in:
Hajime Hoshi 2017-07-20 02:20:15 +09:00
parent 94c4a76dcf
commit b58d8bb996
2 changed files with 4 additions and 4 deletions

View File

@ -151,10 +151,10 @@ func update(screen *ebiten.Image) error {
msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS())
const x = 20
text.Draw(screen, mplusNormalFont, msg, x, 40, color.White)
text.Draw(screen, mplusNormalFont, sampleText, x, 80, color.White)
text.Draw(screen, msg, mplusNormalFont, x, 40, color.White)
text.Draw(screen, sampleText, mplusNormalFont, x, 80, color.White)
for i, line := range strings.Split(string(kanjiText), "\n") {
text.Draw(screen, mplusBigFont, line, x, 160+54*i, codeToColor(kanjiText[0]))
text.Draw(screen, line, mplusBigFont, x, 160+54*i, codeToColor(kanjiText[0]))
}
return nil
}

View File

@ -258,7 +258,7 @@ var textM sync.Mutex
// It is OK to call this function with a same text and a same face at every frame.
//
// This function is concurrent-safe.
func Draw(dst *ebiten.Image, face font.Face, text string, x, y int, clr color.Color) {
func Draw(dst *ebiten.Image, text string, face font.Face, x, y int, clr color.Color) {
textM.Lock()
n := now()