[visionegg] Re: changing screen dimensions dynamically
- From: Mark Halko <mhalko@xxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Thu, 26 Jan 2006 12:00:51 -0500
On Jan 26, 2006, at 11:16 AM, Russ Poldrack wrote:
hi - I'm writing a program that is meant to be run across multiple
computers with different screen resolutions, and I'm wondering whether
there is any way to adjust the default size used by
get_default_screen() to maximize the screen size depending upon the
video resolution of the system? The obvious way would be to have the
user enter the dimensions in the initial config window, but I would
like to make it automatic so that the user doesn't have to determine
what their screen resolution is. I know how to get the maximum screen
size using Tk. I see that there is a set_size() method under the
VisionEgg Screen class, but it seems to be deprecated. One apparent
possibility is to turn off the initial display of the screen
using VisionEgg.config.VISIONEGG_GUI_INIT - however, it's not then
clear to me how to actually set the parameters and display the
screen. Any suggestions would be most appreciated.
I'd use pygame to query the maximum screensize:
>>> import pygame
>>> pygame.display.init()
>>> pygame.display.list_modes()
[(1920, 1440), (1856, 1392), (1792, 1344), (1600, 1200), (1600, 1024),
(1344, 1008), (1280, 1024), (1280, 960), (1152, 870), (1152, 864),
(1024, 768), (832, 624), (800, 600), (640, 480)]
or:
>>> max(pygame.display.list_modes())
(1920, 1440)
You can then use the default constructor for the Screen class yourself:
screen = Screen(size = (1024, 768), fullscreen = True, red_bits = 8,
green_bits = 8, blue_bits = 8,alpha_bits = 8)
where (1024,768) is your desired screen size.
The get_default_screen is just an alternate constructor. If you want
to use the config file for other options, you can omit them in the
constructor, and the constructor will find them in the config file (at
least, that's what the source claims to do)
Check the source for Screen.__init__ in Core.py :
http://visionegg.org/cgi-bin/viewcvs.cgi/trunk/visionegg/src/Core.py?
rev=1338&view=markup
Also - is there any way to specify a particular VisionEgg.cfg file to
be read in, rather than the default locations?
I haven't personally done it, but in Configuration.py it says:
However, You can specify a different filename and directory by setting
the environment variable VISIONEGG_CONFIG_FILE.
Mark
=====================================The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- Follow-Ups:
- [visionegg] Re: changing screen dimensions dynamically
- From: Douglas Taylor
- References:
- [visionegg] changing screen dimensions dynamically
- From: Russ Poldrack
Other related posts:
- » [visionegg] changing screen dimensions dynamically
- » [visionegg] Re: changing screen dimensions dynamically
- » [visionegg] Re: changing screen dimensions dynamically
- » [visionegg] Re: changing screen dimensions dynamically
- » [visionegg] Re: changing screen dimensions dynamically
- » [visionegg] Re: changing screen dimensions dynamically
On Jan 26, 2006, at 11:16 AM, Russ Poldrack wrote:
Also - is there any way to specify a particular VisionEgg.cfg file to be read in, rather than the default locations?
I haven't personally done it, but in Configuration.py it says:
- [visionegg] Re: changing screen dimensions dynamically
- From: Douglas Taylor
- [visionegg] changing screen dimensions dynamically
- From: Russ Poldrack