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

Re: [pygame] pygsear, pygame framework & examples



> More information & screenshots:
>
> http://www.nongnu.org/pygsear/
>
> Feedback welcome.

Sorry for the slow response ;)

There is a detail which I do not understand. I was trying to tile
an image over a background, when I encountered the following code
in screen.py (lines 82-85):

           bg = pygame.Surface(conf.WINSIZE)
            for y in range(0, conf.WINSIZE[1], i.get_height()):
                for x in range(0, conf.WINSIZE[0], i.get_width()):
                    bg.blit(i, (x, y))

Is this correct? It seems to me the WINSIZE is hardcoded here. I
loaded Window with (1024, 768) as size, and my image (sized
66x34) pixels is not properly tiled.

What is the current status op Pygsear? Is there a public CVS tree? I
want to contribute to it: write documentation, fix bugs (I think the
above is a bug), and maybe add new features; I have two main problems
with my current project: a 'level' can be approx. 8000x8000 pixels large,
so scaling or tiling one big background image is no option, but runtime
scaling a portion of a small background image is too slow. My other problem
is the speed of scrolling, I am thinking of solutions for this; in both
cases, it is a more general problem which might reside well is a gaming
library on top of pygame, as is pygsear.


Hi;

Yes, I am actively working on this project. You can get the latest
release and/or access the CVS at the website:

http://www.nongnu.org/pygsear/
http://savannah.nongnu.org/projects/pygsear/



Re: tiling a background:

the WINSIZE is kept in the conf module so that all of the other
modules know where to access it. I was working over the weekend to
create a "configuration" screen that will allow players to change
window size, re-bind keys, go full-screen and back, etc. The start
is in the latest release. I hope to have it working by next week.


The setBackground() function is overloaded. It is defined as:

class Window:
def setBackground(self, image=None, tile=0, color=BLACK):
...


So, if you have a full size image, you would use:
window.setBackground('full_size.png')

Or, if you have a tile image, you would use:
window.setBackground('tile_image.png', tile=1)

Or, if you just want to use a solid color, you would use:
window.setBackground(color=RED)


That one actually has a doc string... :o)


I like the idea of having some different modules that do
things like show a scrolling window in to a large map.

There is also a pygsear mailing list available at the
savannah site if people feel this is too off-topic for
the general pygame list.


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

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org