faiface / pixel

A hand-crafted 2D game library in Go
MIT License
4.46k stars 246 forks source link

Support setting an initial window position #235

Closed fgrosse closed 4 years ago

fgrosse commented 4 years ago

This change allows users to specify the initial window position when they create the window. The advantage over calling Window.SetPos(…) after the window was created is, that the user will not see the window jump upon startup but it will directly spawn where we want it.

The method of marking the window at invisible is the suggested solution that is documented at glsw.CreateWindow(…):

To create the window at a specific position, make it initially invisible using the Visible window hint, set its position and then show it.

delp commented 4 years ago

:beers: