mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-28 19:52:43 +01:00
examples/noise: Show FPS
This commit is contained in:
parent
7f60cd41eb
commit
bd13e96727
@ -62,9 +62,11 @@ func (g *Game) Update() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var offscreen = ebiten.NewImage(320, 240)
|
||||||
|
|
||||||
func (g *Game) Draw(screen *ebiten.Image) {
|
func (g *Game) Draw(screen *ebiten.Image) {
|
||||||
screen.ReplacePixels(g.noiseImage.Pix)
|
screen.ReplacePixels(g.noiseImage.Pix)
|
||||||
ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f", ebiten.CurrentTPS()))
|
ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f\nFPS: %0.2f", ebiten.CurrentTPS(), ebiten.CurrentFPS()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user