pygsear-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygsear] config canvas dimensions


From: Lee Harr
Subject: Re: [pygsear] config canvas dimensions
Date: Sat, 29 Mar 2003 16:21:55 +0000

Hi,
I'd like to use a full screen canvas. I can find the dimensions using the forward command in the python2.2 module turtle.py. The process is:
invoke python interpreter
$ python
>>>from turtle import *
>>>reset()
#######at this point you'll see a canvas open,
use your expand button on the canvas###########

>>>reset()
############you will now have a full screen canvas with the pen centered. From here you can issue forward commands to the edges of the canvas to find it's full screen dimensions#############

if my canvas dimension is (1200,800), how can I inform the penguin.py?
TIA
re-v



There a few ways you might do this...

If you are on a unix system, you can use the game configuration
system to save your preferred window size. Start a game, (maybe
accel.py) press [ESC] then use [PAGE UP] and [PAGE DOWN] to
get the screen to the size you want. If you want a fullscreen
mode, you could click on the Full/ Window button, and then
click Save.

You could then go in to the saved configuration file and edit
it to be exactly 1200x800. It would be at ~/.pygsear/config

I have not worked out how to do that on windows yet...


The Turtle/ Penguin also has the grow() and shrink() methods.
That might be the easiest way.

So, if you know the screen defaults to 800x600, you could create
a Penguin subclass like this:


class MyPenguin(penguin.Penguin):
   def __init__(self):
       penguin.Penguin.__init__(self)
       # if you want a FULLSCREEN mode, do this:
       # from pygsear import conf
       # conf.WINFULL = 1

       # grow x-dimension from 800 to 1200
       #  and y-dimension from 600 to 800
       self.grow(400, 200)



Maybe I will add a Turtle method maximize() or something like that.

Be careful with that FULLSCREEN mode in an interactive session...
you won't be able to give the penguin any commands.

If you are making a sort of demo, like when you run penguin.py,
you might want to put it in the Game framework like in the latest
version. That way the viewer can change the video mode to taste.


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]