Python Forum
pygame get window position
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame get window position
#2
Most of the time pygame is used as the sole GUI. It is not ideal to use with tkinter as people often do, for example. Pygame is designed to be the sole GUI while playing a game, not mixed with other GUI to be positioned on the monitor.
os.environ['SDL_VIDEO_WINDOW_POS']='{},{}'.format(100,200)
this sets the environmental variable for SDL which pygame uses to position the window in that spot. However this variable is static....it does not change as you move the window. It is only useful for setting the initial location of the window to be spawned.

All of pygame.display methods are pertaining to the window itself, is current size and width, etc. not its location on the screen.

To be honest you may have to ask the developers on this one.
Recommended Tutorials:
Reply


Messages In This Thread
pygame get window position - by vskarica - Oct-11-2020, 09:10 PM
RE: pygame get window position - by metulburr - Oct-11-2020, 11:48 PM
RE: pygame get window position - by vskarica - Oct-12-2020, 07:04 AM
RE: pygame get window position - by nilamo - Oct-18-2020, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Cannot display anything inside pygame window the_gullwing 5 1,332 Dec-07-2023, 02:44 AM
Last Post: Benixon
  [PyGame] drawing images onto pygame window djwilson0495 1 3,562 Feb-22-2021, 05:39 PM
Last Post: nilamo
  Unable to exit Pygame window Hesper 2 3,952 Mar-30-2020, 08:59 AM
Last Post: Hesper
  [pyGame] More Text in one Window, example needed ! JamieVanCadsand 1 3,610 Oct-03-2017, 03:42 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020