doc: Update

This commit is contained in:
Hajime Hoshi 2017-07-17 06:43:37 +09:00
parent 20a43a88e8
commit d8d36c58fb
2 changed files with 9 additions and 13 deletions

View File

@ -106,7 +106,6 @@ type Player struct {
seBytes []uint8
seCh chan []uint8
volume128 int
previousPos time.Duration
}
var (
@ -277,12 +276,6 @@ Press S to toggle Play/Pause
Press P to play SE
Press Z or X to change volume of the music
%s`, ebiten.CurrentFPS(), currentTimeStr)
current := p.audioPlayer.Current()
prev := p.previousPos
p.previousPos = p.audioPlayer.Current()
if p.audioPlayer.IsPlaying() && prev == current {
msg += "\nLoading..."
}
ebitenutil.DebugPrint(screen, msg)
}

View File

@ -35,14 +35,15 @@ import (
"io/ioutil"
"log"
"math/rand"
"strings"
"time"
"github.com/golang/freetype/truetype"
"golang.org/x/image/font"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
"github.com/hajimehoshi/ebiten/text"
"github.com/golang/freetype/truetype"
"golang.org/x/image/font"
)
const (
@ -163,9 +164,11 @@ func update(screen *ebiten.Image) error {
msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS())
const x = 20
text.Draw(screen, mplusNormalFont, msg, x, 40, 30, color.White)
text.Draw(screen, mplusNormalFont, sampleText, x, 80, 30, color.White)
text.Draw(screen, mplusBigFont, string(kanjiText), x, 160, 54, codeToColor(kanjiText[0]))
text.Draw(screen, mplusNormalFont, msg, x, 40, color.White)
text.Draw(screen, mplusNormalFont, sampleText, 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]))
}
return nil
}