2021-07-23 13:12:54 +10:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2021-07-23 17:05:05 +10:00
|
|
|
"math"
|
2021-07-23 13:12:54 +10:00
|
|
|
|
|
|
|
"github.com/hajimehoshi/ebiten/v2"
|
|
|
|
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TPSDisplay debugprints CurrentTPS in the top left.
|
|
|
|
type TPSDisplay struct{}
|
|
|
|
|
|
|
|
func (TPSDisplay) Draw(screen *ebiten.Image) {
|
|
|
|
ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f", ebiten.CurrentTPS()))
|
|
|
|
}
|
2021-07-23 13:46:19 +10:00
|
|
|
|
2021-07-23 17:05:05 +10:00
|
|
|
func (TPSDisplay) Z() float64 {
|
|
|
|
// Always draw on top
|
|
|
|
return math.MaxFloat64
|
2021-07-23 13:46:19 +10:00
|
|
|
}
|