mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-09 20:47:26 +01:00
ebiten: remove (*Monitor).Bounds()
Now the unit of Bounds is device-dependent pixels, and this is useless and Ebitengine API always treat device-independent pixels. Rather, this might confuse users. Until we find a good solution, let's remove Bounds() for v2.6. MonitorType itself is still useful to specify a monitor to show a window.
This commit is contained in:
parent
b3058b68a0
commit
a269cf3785
@ -57,7 +57,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
|||||||
|
|
||||||
lines = append(lines, "")
|
lines = append(lines, "")
|
||||||
for i, m := range g.monitors {
|
for i, m := range g.monitors {
|
||||||
lines = append(lines, fmt.Sprintf("%d: %s %s", i, m.Name(), m.Bounds().String()))
|
lines = append(lines, fmt.Sprintf("%d: %s", i, m.Name()))
|
||||||
}
|
}
|
||||||
|
|
||||||
activeMonitor := ebiten.Monitor()
|
activeMonitor := ebiten.Monitor()
|
||||||
|
@ -15,20 +15,12 @@
|
|||||||
package ebiten
|
package ebiten
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"image"
|
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/ui"
|
"github.com/hajimehoshi/ebiten/v2/internal/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MonitorType represents a monitor available to the system.
|
// MonitorType represents a monitor available to the system.
|
||||||
type MonitorType ui.Monitor
|
type MonitorType ui.Monitor
|
||||||
|
|
||||||
// Bounds returns the position and size of the monitor in pixels.
|
|
||||||
// Be careful that the unit is not device-independent pixels.
|
|
||||||
func (m *MonitorType) Bounds() image.Rectangle {
|
|
||||||
return (*ui.Monitor)(m).Bounds()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Name returns the monitor's name. On Linux, this reports the monitors in xrandr format.
|
// Name returns the monitor's name. On Linux, this reports the monitors in xrandr format.
|
||||||
// On Windows, this reports "Generic PnP Monitor" for all monitors.
|
// On Windows, this reports "Generic PnP Monitor" for all monitors.
|
||||||
func (m *MonitorType) Name() string {
|
func (m *MonitorType) Name() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user