mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Add DeviceScale() experimentally
This commit is contained in:
parent
c82809867d
commit
d18fc36040
@ -167,6 +167,8 @@ FPS: %0.2f`, x, y, ebiten.CurrentFPS())
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Device scale: %0.2f\n", ebiten.DeviceScale())
|
||||
|
||||
var err error
|
||||
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
|
5
run.go
5
run.go
@ -20,6 +20,7 @@ import (
|
||||
|
||||
"github.com/hajimehoshi/ebiten/internal/audiobinding"
|
||||
"github.com/hajimehoshi/ebiten/internal/clock"
|
||||
"github.com/hajimehoshi/ebiten/internal/devicescale"
|
||||
"github.com/hajimehoshi/ebiten/internal/ui"
|
||||
)
|
||||
|
||||
@ -283,3 +284,7 @@ func SetRunnableInBackground(runnableInBackground bool) {
|
||||
func SetWindowIcon(iconImages []image.Image) {
|
||||
ui.SetWindowIcon(iconImages)
|
||||
}
|
||||
|
||||
func DeviceScale() float64 {
|
||||
return devicescale.DeviceScale()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user