mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
doc: Update
This commit is contained in:
parent
20a43a88e8
commit
d8d36c58fb
@ -106,7 +106,6 @@ type Player struct {
|
|||||||
seBytes []uint8
|
seBytes []uint8
|
||||||
seCh chan []uint8
|
seCh chan []uint8
|
||||||
volume128 int
|
volume128 int
|
||||||
previousPos time.Duration
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -277,12 +276,6 @@ Press S to toggle Play/Pause
|
|||||||
Press P to play SE
|
Press P to play SE
|
||||||
Press Z or X to change volume of the music
|
Press Z or X to change volume of the music
|
||||||
%s`, ebiten.CurrentFPS(), currentTimeStr)
|
%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)
|
ebitenutil.DebugPrint(screen, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,14 +35,15 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang/freetype/truetype"
|
||||||
|
"golang.org/x/image/font"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten"
|
"github.com/hajimehoshi/ebiten"
|
||||||
"github.com/hajimehoshi/ebiten/ebitenutil"
|
"github.com/hajimehoshi/ebiten/ebitenutil"
|
||||||
"github.com/hajimehoshi/ebiten/text"
|
"github.com/hajimehoshi/ebiten/text"
|
||||||
|
|
||||||
"github.com/golang/freetype/truetype"
|
|
||||||
"golang.org/x/image/font"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -163,9 +164,11 @@ func update(screen *ebiten.Image) error {
|
|||||||
|
|
||||||
msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS())
|
msg := fmt.Sprintf("FPS: %0.2f", ebiten.CurrentFPS())
|
||||||
const x = 20
|
const x = 20
|
||||||
text.Draw(screen, mplusNormalFont, msg, x, 40, 30, color.White)
|
text.Draw(screen, mplusNormalFont, msg, x, 40, color.White)
|
||||||
text.Draw(screen, mplusNormalFont, sampleText, x, 80, 30, color.White)
|
text.Draw(screen, mplusNormalFont, sampleText, x, 80, color.White)
|
||||||
text.Draw(screen, mplusBigFont, string(kanjiText), x, 160, 54, codeToColor(kanjiText[0]))
|
for i, line := range strings.Split(string(kanjiText), "\n") {
|
||||||
|
text.Draw(screen, mplusBigFont, line, x, 160+54*i, codeToColor(kanjiText[0]))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user