ui: Rename DeviceScale -> DeviceScaleFactor

This commit is contained in:
Hajime Hoshi 2018-01-03 19:23:29 +09:00
parent a64367f906
commit dc75e69d1e
2 changed files with 7 additions and 7 deletions

View File

@ -167,7 +167,7 @@ FPS: %0.2f`, x, y, ebiten.CurrentFPS())
} }
func main() { func main() {
fmt.Printf("Device scale: %0.2f\n", ebiten.DeviceScale()) fmt.Printf("Device scale factor: %0.2f\n", ebiten.DeviceScaleFactor())
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest)

12
run.go
View File

@ -108,7 +108,7 @@ func (u *updater) Invalidate() {
// by the device scale on high-DPI display. // by the device scale on high-DPI display.
// If you pass inverse of the device scale, // If you pass inverse of the device scale,
// you can disable this automatical device scaling as a result. // you can disable this automatical device scaling as a result.
// You can get the device scale by DeviceScale function. // You can get the device scale by DeviceScaleFactor function.
// //
// Run must be called from the OS main thread. // Run must be called from the OS main thread.
// Note that Ebiten bounds the main goroutine to the main OS thread by runtime.LockOSThread. // Note that Ebiten bounds the main goroutine to the main OS thread by runtime.LockOSThread.
@ -184,7 +184,7 @@ func SetScreenSize(width, height int) {
// by the device scale on high-DPI display. // by the device scale on high-DPI display.
// If you pass inverse of the device scale, // If you pass inverse of the device scale,
// you can disable this automatical device scaling as a result. // you can disable this automatical device scaling as a result.
// You can get the device scale by DeviceScale function. // You can get the device scale by DeviceScaleFactor function.
// //
// This function is concurrent-safe. // This function is concurrent-safe.
func SetScreenScale(scale float64) { func SetScreenScale(scale float64) {
@ -296,12 +296,12 @@ func SetWindowIcon(iconImages []image.Image) {
ui.SetWindowIcon(iconImages) ui.SetWindowIcon(iconImages)
} }
// DeviceScale returns a device scale value. // DeviceScaleFactor returns a device scale value.
// //
// DeviceScale returns a meaningful value on high-DPI display environment, // DeviceScaleFactor returns a meaningful value on high-DPI display environment,
// otherwise DeviceScale returns 1. // otherwise DeviceScaleFactor returns 1.
// //
// This function is concurrent-safe. // This function is concurrent-safe.
func DeviceScale() float64 { func DeviceScaleFactor() float64 {
return devicescale.DeviceScale() return devicescale.DeviceScale()
} }