add GetPos function to window
This commit is contained in:
parent
5e2a944a48
commit
3c78161418
|
@ -244,6 +244,18 @@ func (w *Window) SetPos(pos pixel.Vec) {
|
||||||
w.window.SetPos(left, top)
|
w.window.SetPos(left, top)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetPos gets the position, in screen coordinates, of the upper-left corner
|
||||||
|
// of the client area of the window. The position is rounded to integers.
|
||||||
|
func (w *Window) GetPos() pixel.Vec {
|
||||||
|
var v pixel.Vec
|
||||||
|
mainthread.Call(func() {
|
||||||
|
x, y := w.window.GetPos()
|
||||||
|
v = pixel.V(float64(x), float64(y))
|
||||||
|
})
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
// Bounds returns the current bounds of the Window.
|
// Bounds returns the current bounds of the Window.
|
||||||
func (w *Window) Bounds() pixel.Rect {
|
func (w *Window) Bounds() pixel.Rect {
|
||||||
return w.bounds
|
return w.bounds
|
||||||
|
|
Loading…
Reference in New Issue