[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] SDL_VIDEO_CENTERED and Python 2.5



So what OS are you running?

Do you have multiple monitors now? Are you running an nvidia desktop
management tool or anything like that?

...From the output it seems your pygame is using 1.2.7, which should
be when support for the positioning environment variables was added to
windows... my machine is using SDL 1.2.13, which should be different
in that it uses windib instead of directx for the window - however
forcing directX on my machine still centers... you can try forcing
windib with SDL 1.2.7 by putting os.environ['SDL_VIDEODRIVER'] =
'windib' before pygame.init()

if you're on win or mac and are up for trying a unstable build from
svn with latest SDL, you can get an installer here:
http://thorbrian.com/pygame/builds.php


On Sun, Feb 24, 2008 at 2:37 PM, PyMike <pymike93@xxxxxxxxx> wrote:
> I ran your script and it did not center.
>
> Output:
>
> >>>
> 1.8.0rc3
> (1, 2, 7)
>
>
> >>>
>
> On Sun, Feb 24, 2008 at 4:33 PM, Brian Fisher <brian@xxxxxxxxxxxxxxxxxxx>
> wrote:
>
> > This script creates a centered window for me on Windows XP with 1.8.0rc3
> > ----------------------------------
> > import pygame
> > import os
> >
> > print pygame.ver
> > print pygame.get_sdl_version()
> >
> > pygame.init()
> >
> >
> > os.environ["SDL_VIDEO_CENTERED"] = "1"
> > pygame.display.set_mode((320,240))
> >
> > running = True
> > while running:
> >    for event in pygame.event.get():
> >        if event.type == pygame.QUIT or (event.type == pygame.KEYDOWN
> > and event.key == pygame.K_ESCAPE):
> >            running = 0
> >    pygame.display.flip()
> >
> > ----------------------------------
> >
> > if it doesn't work for you, what OS are you running, and what console
> > output did you get (i.e. what version of pygame and sdl)?
> >
>
>
>
> --
> - PyMike