I see where you're coming from...
Yes, depth refers to 32bit/16bit etc. the flags are documented, but default to fullscreen.
So... pygame.display.list_modes(32)
will return a list of all possible screen sizes with 32bit colour depth, like so -
>>> import pygame.display
>>> pygame.display.init() #Need to do this first
>>> pygame.display.list_modes(32)
[(1152, 720), (800, 600), (1280, 1024), (1280, 960), (1280, 800), (1280, 768), (1280, 720), (1152, 864), (1024, 768), (960, 600), (848, 480), (800, 600), (720, 576), (720, 480), (640, 480), (640, 400), (512, 384), (480, 360), (400, 300), (320, 240), (320, 200), (640, 480)]
And then you can have your images saved for different res's, like this -
./images/1024768/foo.jpg
./images/1024768/bar.jpg
./images/800600/foo.jpg
./images/800600/bar.jpg
and do something like -
>>>import pygame
>>>import os
>>> pygame.display.init() #Initialise display interface
>>> modes = pygame.display.list_modes(32)
>>>if (1024, 768) in modes:
... imageSet = './images/1024768/'
... pygame.display.set_mode((1024,768))
... elif (800, 600) in modes:
... imageSet = './images/800600/
... pygame.display.set_mode((800,600))
>>> images = ['foo.jpg','bar.jpg']
>>> files = [os.join(imageSet, filename) for filename in images] #assuming 1024x768 was available.
>>>print files
['./images/1024768/foo.jpg', './images/1024768/bar.jpg']
So basically my point can be summarised as -
You can query the systems available resolutions for a given colour depth, FULLSCREEN is default, so any returned res's can run fullscreen.
Decide what resolutions you want to support, 1024x768 & 800x600 are 90% of people, 1280x1024 is also popular with big monitors, you could do 640x400 for backwards compatibility.
Then -
- Have appropriately sized images for each supported res
- Query the available res's
- Depending on what's available, set your desired resolution. (Or, have it as an option for the user)
- Display your images.
You can query the current res on Windows, but it involves the win32com package, and far more esoteric ActiveX/COM interface manipulations, the way described above is far simpler.
I hope that helps. Follow the pygame tutorials and docs, and you should be right. Pygame is very powerful. http://www.pygame.org/docs/tut/DisplayModes.html
Regards,
Liam Clarke
On 5/11/05, EUGENE ASTLEY <[EMAIL PROTECTED]> wrote:
Thank you. I intend to fill the background screen by brining in a jpg file. If I know the size of the screen, I will know what size jpg file to import.
However, what does depth and flags refer to? Does depth refer to 32 bit resolution? Still not clear how I get the values of the width and height resolution being used.
Gene
-----Original Message-----
From: Liam Clarke [mailto:[EMAIL PROTECTED]]Sent: Tuesday, May 10, 2005 6:19 PM
To: EUGENE ASTLEY; tutor@python.org
Subject: Re: [Tutor] computer screen resolution
If it's built on pygame then the following should work -
>From http://www.pygame.org/docs/tut/DisplayModes.html
pygame.display.list_modes(depth, flags)Returns a list of supported display modes with the requested depth and flags. An empty list is returned when there are no modes. The flags argument defaults to FULLSCREEN. If you specify your own flags without FULLSCREEN, you will likely get a return value of -1. This means that any display size is fine, since the display will be windowed. Note that the listed modes are sorted largest to smallest.
But, I think this'll solve your problem, using the following command you can always set fullscreen. You should be able to just use -
>>>import pygame
>>>pygame.display.list_modes(16) #Does it handle 16 bit?
Oh, and OpenGL is hardware rendering, supposedly faster on some systems, but far slower to work with.
Blitting with it is a bitch, quite frankly.
pygame.display.toggle_fullscreen() -> boolTells the window manager (if available) to switch between windowed and fullscreen mode. If available and successfull, will return true. Note, there is currently limited platform support for this call.
On 5/11/05, EUGENE ASTLEY < [EMAIL PROTECTED]> wrote:
Yes, livewires is a pygame wrapper to make pygame easier for the novice to use, such as me. I just want to have my game operate on PC's using XP. I don't want to ask the user to input his resolution, even though I know how to program this method.
I appreciate your comment but being a novice at programming I don't know what an openGL means although I can guess. I can't find anyplace that lets me look at the list of operating commands available for use and the syntax required to use them in pygame.
Gene Astley
-----Original Message-----
From: Liam Clarke [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 10, 2005 4:20 AM
To: EUGENE ASTLEY; tutor@python.org
Subject: Re: [Tutor] computer screen resolution
Is Livewires a game development package? I'm pretty sure pygame can do what you want, it can handle OpenGL if you're into pain.
www.pygame.org
Plus, it plays MP3's and MPGs easily. :)
Regards,
Liam ClarkeOn 5/10/05, EUGENE ASTLEY < [EMAIL PROTECTED]> wrote:
I would like to have a full screen for the game I have programmed regardless of the computer users screen resolution. Is their a way from Python or livewires that I can get the info from the computer and then enter it into the global SCREEN_WIDTH and SCREEN_HEIGHT?
Gene
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.'
--
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.'
--
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.'
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor