mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57: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. Closes #2780
This commit is contained in:
parent
4da27902f4
commit
0170598a82
@ -57,7 +57,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
||||
|
||||
lines = append(lines, "")
|
||||
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()
|
||||
|
@ -15,20 +15,12 @@
|
||||
package ebiten
|
||||
|
||||
import (
|
||||
"image"
|
||||
|
||||
"github.com/hajimehoshi/ebiten/v2/internal/ui"
|
||||
)
|
||||
|
||||
// MonitorType represents a monitor available to the system.
|
||||
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.
|
||||
// On Windows, this reports "Generic PnP Monitor" for all monitors.
|
||||
func (m *MonitorType) Name() string {
|
||||
|
Loading…
Reference in New Issue
Block a user