Re: [pygame] Pygame font issues

2009-05-02 Thread Peter Chant
On Friday 01 May 2009, Jake b wrote:
 1) Are you using py2exe?


No.

 2) Copy-ing the font to the same folder as the game will probably work.


Unfortuately it did not.

 3) I ripped out my font name matching code, it might help. [It might
 be easier if you want the whole font wrapper class.]


Thanks.  I'm not sure that it does.  You've created a wrapper, which does some 
useful checking, but at the end of the day it still appears to make a simple 
call with a font name.

font = pygame.font.Font(None, 36)
#font = pygame.font.Font('liberationserif',36)

I suspect it is a path problem, but I'm new to python and am not really sure 
how to fix it.  In fact, I have just found that if I pass the file path it 
does not throw an error.

Unfortunately I still have not got test displayed for other reasons I am just 
learning.  However, it is a sunny day so perhaps I ought to take advantage of 
it.

Pete






-- 
Peter Chant
http://www.petezilla.co.uk


Re: [pygame] pygame 2001-2009(8 years), 1100+ projects at super speed.

2009-05-02 Thread Alex Holkner
On Sat, May 2, 2009 at 2:29 AM, René Dudfield ren...@gmail.com wrote:
 hellos,

 I have put together a video representing some of the pygame work out there.

 Enjoy!        http://www.youtube.com/watch?v=Qu2Tuo3HPbo


Nice idea.  I recognised a handful of pyglet projects in there though ;-)

Alex.


Re: [pygame] Pygame font issues

2009-05-02 Thread Yanom Mobis
does

font = pygame.font.Font(None, 36)

use the player's default system font?

--- On Sat, 5/2/09, Peter Chant p...@petezilla.co.uk wrote:

From: Peter Chant p...@petezilla.co.uk
Subject: Re: [pygame] Pygame font issues
To: pygame-users@seul.org
Date: Saturday, May 2, 2009, 5:12 AM


-Inline Attachment Follows-

On Friday 01 May 2009, Jake b wrote:
 1) Are you using py2exe?


No.

 2) Copy-ing the font to the same folder as the game will probably work.


Unfortuately it did not.

 3) I ripped out my font name matching code, it might help. [It might
 be easier if you want the whole font wrapper class.]


Thanks.  I'm not sure that it does.  You've created a wrapper, which does some 
useful checking, but at the end of the day it still appears to make a simple 
call with a font name.

    font = pygame.font.Font(None, 36)
    #font = pygame.font.Font('liberationserif',36)

I suspect it is a path problem, but I'm new to python and am not really sure 
how to fix it.  In fact, I have just found that if I pass the file path it 
does not throw an error.

Unfortunately I still have not got test displayed for other reasons I am just 
learning.  However, it is a sunny day so perhaps I ought to take advantage of 
it.

Pete






-- 
Peter Chant
http://www.petezilla.co.uk



  

Re: [pygame] Pygame font issues

2009-05-02 Thread Peter Chant
On Saturday 02 May 2009, Yanom Mobis wrote:
 does

 font = pygame.font.Font(None, 36)

 use the player's default system font?

None does not work:

self.font = pygame.font.Font(None,36)
RuntimeError: default font not found 'freesansbold.ttf'

its looking for freesansbold, which even though it exists, can't be found:

bash-3.1$ locate freesansbold.ttf
/usr/lib/python2.5/site-packages/pygame/freesansbold.ttf

Note, I think your reference to default systems font is a windows reference.  
I'm on linux.

Pete



-- 
Peter Chant
http://www.petezilla.co.uk


[pygame] Cairo + SDL

2009-05-02 Thread Chris McCormick
Hi all,

Recently there was some talk of doing vector graphics in Pygame. Since this is
a subject that is dear to me, I thought I'd ask how hard it would be to
incorporate something like this into Pygame:

http://cairographics.org/SDL/

I realise this probably implies a large amount of work, but I just thought I'd
throw it on to the collective heads-up-display. Would be pretty wonderful to be
able to use Cairo's rendering capabilities from inside Pygame! :)

Best,

Chris.

---
http://mccormick.cx


Re: [pygame] Cairo + SDL

2009-05-02 Thread Brian Fisher
I'm pretty sure pycairo and pygame are already interoperable:
http://www.pjblog.net/index.php?post/2006/06/23/144-using-pycairo-with-pygame-surface

I think you may also be able to do something like this to do pretty much
exactly what that page you linked to does:
--
width = 100
height = 100
pygame_surf = pygame.Surface((width, height), 0, 32, (0xff, 0x00ff00,
0xff, 0))

data = pygame_surf.get_buffer()
stride = pygame_surf.get_pitch()
cairo_surf = cairo.ImageSurface.create_for_data(data, cairo.FORMAT_RGB24,
width, height, stride)

-

... but I haven't tested it


On Sat, May 2, 2009 at 10:16 AM, Chris McCormick ch...@mccormick.cx wrote:

 Hi all,

 Recently there was some talk of doing vector graphics in Pygame. Since this
 is
 a subject that is dear to me, I thought I'd ask how hard it would be to
 incorporate something like this into Pygame:

 http://cairographics.org/SDL/

 I realise this probably implies a large amount of work, but I just thought
 I'd
 throw it on to the collective heads-up-display. Would be pretty wonderful
 to be
 able to use Cairo's rendering capabilities from inside Pygame! :)

 Best,

 Chris.

 ---
 http://mccormick.cx



[pygame] BUG: pygame.event.get(pygame.KEYDOWN) fails

2009-05-02 Thread evilmrhenry

Tested under Linux. (Python 2.5.4, pygame 1.7.1 release 4.2 from Debian)
and Windows. (with a slightly older version of python/pygame)

The code pygame.event.get(pygame.KEYDOWN) does not work correctly. If
called in this manner, it will work, but only for the first 100 or so
keypresses. After a certain point, the get() function will no longer
return the appropriate events, and will instead return an empty list, no
matter what the physical input. pygame.event.get() functions properly.

Below is some test code. When running the first program, the counter
tends to stop at around 120. The 2nd program, which should be identical,
functions as expected.



#Broken
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
counter = 0
while 1:
pygame.time.wait(60)
for event in pygame.event.get(pygame.KEYDOWN):
counter +=1
print counter

---

#Works
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
counter = 0
while 1:
pygame.time.wait(60)
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
counter +=1
print counter



Re: [pygame] BUG: pygame.event.get(pygame.KEYDOWN) fails

2009-05-02 Thread René Dudfield
hi,

why this isn't working, is because when you pass in an event type it
leaves the other events in the queue.  Which means at some point the
queue fills up, and no other events can go on there.

It's not the nicest behaviour... but is working as specified.  It
would be better if it could tell you this was happening.  Maybe with a
warning message somewhere... I'm not sure the best way.  Since, for
some programs, this behaviour is ok.

So I think at least a warning in the documentation for
pygame.event.get(type) is in order.

If you clear the event queue at the end of your loop, it should work.


You can clear the events every loop like this:

#was broken, now working
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
counter = 0
while 1:
   pygame.time.wait(60)
   for event in pygame.event.get(pygame.KEYDOWN):
   counter +=1
   print counter
   pygame.event.clear()



#this is probably better...  getting all the events off the queue each round.
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
counter = 0
while 1:
   pygame.time.wait(60)
   events = pygame.event.get()

   for event in events:
   if e.type in [pygame.KEYDOWN]:
  counter +=1
  print counter




On Sun, May 3, 2009 at 8:38 AM, evilmrhenry evilmrhe...@emhsoft.com wrote:
 Tested under Linux. (Python 2.5.4, pygame 1.7.1 release 4.2 from Debian)
 and Windows. (with a slightly older version of python/pygame)

 The code pygame.event.get(pygame.KEYDOWN) does not work correctly. If
 called in this manner, it will work, but only for the first 100 or so
 keypresses. After a certain point, the get() function will no longer
 return the appropriate events, and will instead return an empty list, no
 matter what the physical input. pygame.event.get() functions properly.

 Below is some test code. When running the first program, the counter
 tends to stop at around 120. The 2nd program, which should be identical,
 functions as expected.



 #Broken
 import pygame
 pygame.init()
 screen = pygame.display.set_mode((640, 480))
 counter = 0
 while 1:
    pygame.time.wait(60)
    for event in pygame.event.get(pygame.KEYDOWN):
        counter +=1
        print counter

 ---

 #Works
 import pygame
 pygame.init()
 screen = pygame.display.set_mode((640, 480))
 counter = 0
 while 1:
    pygame.time.wait(60)
    for event in pygame.event.get():
        if event.type == pygame.KEYDOWN:
            counter +=1
            print counter




Re: [pygame] pygame 2001-2009(8 years), 1100+ projects at super speed.

2009-05-02 Thread René Dudfield
On Sat, May 2, 2009 at 11:27 PM, Alex Holkner alex.holk...@gmail.com wrote:
 On Sat, May 2, 2009 at 2:29 AM, René Dudfield ren...@gmail.com wrote:
 hellos,

 I have put together a video representing some of the pygame work out there.

 Enjoy!        http://www.youtube.com/watch?v=Qu2Tuo3HPbo


 Nice idea.  I recognised a handful of pyglet projects in there though ;-)

 Alex.



Yeah, there's heaps pygame libraries, and libraries derivative of
pygame represented in there.  Even some that are not, like panda games
etc.  Pretty much most of everything listed on the pygame.org projects
section is in there.

If you watch it a few times, and don't blink, you might see your
project.  Took me a couple of goes to see some projects.


Re: [pygame] Pygame font issues

2009-05-02 Thread René Dudfield
hi,

what are the permissions of the font file?  Maybe something weird is
going on there?


cu,

On Sun, May 3, 2009 at 3:14 AM, Peter Chant p...@petezilla.co.uk wrote:
 On Saturday 02 May 2009, Yanom Mobis wrote:
 does

 font = pygame.font.Font(None, 36)

 use the player's default system font?

 None does not work:

    self.font = pygame.font.Font(None,36)
 RuntimeError: default font not found 'freesansbold.ttf'

 its looking for freesansbold, which even though it exists, can't be found:

 bash-3.1$ locate freesansbold.ttf
 /usr/lib/python2.5/site-packages/pygame/freesansbold.ttf

 Note, I think your reference to default systems font is a windows reference.
 I'm on linux.

 Pete



 --
 Peter Chant
 http://www.petezilla.co.uk



[pygame] [GSOC] svn and compile problem with pygame-svn

2009-05-02 Thread el lauwer

Oi,

I am installing the latest version of pygame on svn,
so I can start coding on my camera module. I am
installing it under virtualenv so I can keep using
the stable pygame release for my current games.

1)
I recently reseaved a svn account for the pygame
svn repository. How do you sugest I use this account
during the development prossess, should I use it to
commit all my changes to the main brange, or should
I make a personal brange just for my work on the
camera module. Can I use my github account instead,
if so, what must I do with the changes and bug
fixel to the main pygame development brange.

2)
When I try to compile the pygame version with help
of the MacSVNCompile doc I get the following error:

$ python config.py

Hunting dependencies...
Framework SDL found
Framework SDL_ttf found
Framework SDL_image found
Framework SDL_mixer found
Framework smpeg found
PNG : found
JPEG: found
SCRAP   : not found
PORTMIDI: not found
Framework CoreMidi found

$ python setup.py build

...

ld warning: in /opt/local/lib/libpng.a, file is not of required  
architecture
ld warning: in /opt/local/lib/libjpeg.a, file is not of required  
architecture
ld: in /opt/local/lib/libz.1.dylib, file is not of required  
architecture for architecture ppc

collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/sd/sdb8APIWH4qmd53S-O6k8k++ 
+TI/-Tmp-//cct7zCL5.out (No such file or directory)

error: command 'gcc' failed with exit status 1


In case i should matter, I use fink instead of macports.
Any idea on how to solve this.



Re: [pygame] starting the rewrite

2009-05-02 Thread el lauwer

Oi,

1st: I knowledge in, anf prefere Django
@nd: I will be working on the camera module for osx as part
of gsoc so I won't be having a lot of time. But I will have time
to review code and test security XSS, XSRF.

On 1-mei-09, at 20:12, Jake b wrote:


Maybe we need a vote thread.

1st line: pick your framework
2nd like: amount of work you expect to put in.

No discussion, just vote tallies, so we can see if it's definitely one
sided, and to stick with that. [ keeping discussion in another thread
]

I 2nd shaun. I can write css/php/html, but haven't volunteered yet
since I haven't used django/cherrypy. So I could help if you have
access to that level. [ Haven't written a website in py yet, but it
sounds fun. ]
--
Jake




Re: [pygame] [GSOC] svn and compile problem with pygame-svn

2009-05-02 Thread René Dudfield
Hi,

more below...

On Sun, May 3, 2009 at 2:50 PM, el lauwer el.lau...@gmail.com wrote:

 Oi,

 I am installing the latest version of pygame on svn,
 so I can start coding on my camera module. I am
 installing it under virtualenv so I can keep using
 the stable pygame release for my current games.

 1)
 I recently reseaved a svn account for the pygame
 svn repository. How do you sugest I use this account
 during the development prossess, should I use it to
 commit all my changes to the main brange, or should
 I make a personal brange just for my work on the
 camera module. Can I use my github account instead,
 if so, what must I do with the changes and bug
 fixel to the main pygame development brange.



You might want to work on the main trunk, or not... depending on a number of
things.

Either a separate branch or in your git hub is probably a good way to go.
If you put things in svn, then it's easier for some of the pygame developers
to watch your work, and maybe even make changes.  However it's up to you.

Best to merge your work in occasionally into a svn branch at least.   Or
send the mailing list a link to your work when you've committed something
you'd like people to look at or merge in.

Then when your work is getting along, talk about merging it into the trunk
with the mailing list and other developers.  If no one has changed any of
the files you have changed, then it's probably ok.

Working in the trunk lets you take advantage of some other things... like
the build bots which build on mac/win python2.4 python2.5 python2.6 and run
the tests for you.  So it can save you a lot of testing work.

Say you wanted to make some changes to surface.c and a bunch of others that
aren't part of the camera module directly, and didn't commit to trunk for a
few weeks... there's a good chance someone else might make changes to those
files.

As long as you communicate with other devs what your working on it should be
fine.






 2)
 When I try to compile the pygame version with help
 of the MacSVNCompile doc I get the following error:

 $ python config.py

 Hunting dependencies...
 Framework SDL found
 Framework SDL_ttf found
 Framework SDL_image found
 Framework SDL_mixer found
 Framework smpeg found
 PNG : found
 JPEG: found
 SCRAP   : not found
 PORTMIDI: not found
 Framework CoreMidi found

 $ python setup.py build

 ...

 ld warning: in /opt/local/lib/libpng.a, file is not of required
 architecture
 ld warning: in /opt/local/lib/libjpeg.a, file is not of required
 architecture
 ld: in /opt/local/lib/libz.1.dylib, file is not of required architecture
 for architecture ppc
 collect2: ld returned 1 exit status
 lipo: can't open input file:
 /var/folders/sd/sdb8APIWH4qmd53S-O6k8k+++TI/-Tmp-//cct7zCL5.out (No such
 file or directory)
 error: command 'gcc' failed with exit status 1


 In case i should matter, I use fink instead of macports.
 Any idea on how to solve this.



it looks like the files you're linking against do not have a ppc version in
them.

There's a note in the compile doc about how to get a universal binary, if
you can't compile one yourself.
http://pygame.org/wiki/MacCompile?parent=index#%20Install%20Universal%20build%20libjpeg%20%20libpng




cheers,


Re: [pygame] Movie module information

2009-05-02 Thread René Dudfield
Hi,

it looks like SDL_ffmpeg 1.0 has been released:
http://www.arjanhouben.nl/SDL_ffmpeg/



On Tue, Apr 28, 2009 at 4:13 AM, Lenard Lindstrom le...@telus.net wrote:

 Here is my first attempt at ffmpeg for Windows. It is for Python's 2.4 and
 2.5:

 http://www3.telus.net/len_l/pygame/experimental/ffmpeg.tar.gz

 md5sum:
 db4d51a61dbd56a1453e332774dfa494 *ffmpeg.tar.gz

 Lenard


 Lenard Lindstrom wrote:


 Tyler Laing wrote:

 Hello all,

 One of the first steps I need to take for the GSoC project is to get user
 stories so I can build acceptance tests.

 I want to hear what you guys(the users) want out of an updated movie
 module. What do you want to be able to do, and how?

 I'm also interested in hearing what people liked and didn't like about
 the current movie module.

 -Tyler

 --
 Visit my blog at http://oddco.ca/zeroth/zblog




 P.S.

 I am working on getting the ffmpeg libraries ready for Windows. I have
 built them using the proper C runtime for Python 2.5 (cross-compiled from
 linux). Once I can collect together the necessary headers and import
 libraries I will bundle them up and make them available. But they will have
 limited capability for now. I have only succeeded with an mpg to avi
 conversion so far. After this I will try customizing msys_build_deps.py for
 ffmpeg.

 L.L.



 --
 Lenard Lindstrom
 le...@telus.net




Re: [pygame] [GSOC] svn and compile problem with pygame-svn

2009-05-02 Thread Nirav Patel
I personally found/find it useful to use a personal git repo, and use
git-svn to stay up to date with the Pygame SVN.  You can use git svn
rebase to keep your repo up to date with upstream and then commit
with git svn dcommit when you have code that others can
use/test/hack.

There is a decent guide for using git-svn with github here:
http://www.fnokd.com/2008/08/20/mirroring-svn-repository-to-github/

That is also useful so you have a repo to work in until 1.9 is
released and you can start committing to Pygame SVN.

Nirav

On Sun, May 3, 2009 at 1:10 AM, René Dudfield ren...@gmail.com wrote:
 Hi,

 more below...

 On Sun, May 3, 2009 at 2:50 PM, el lauwer el.lau...@gmail.com wrote:

 Oi,

 I am installing the latest version of pygame on svn,
 so I can start coding on my camera module. I am
 installing it under virtualenv so I can keep using
 the stable pygame release for my current games.

 1)
 I recently reseaved a svn account for the pygame
 svn repository. How do you sugest I use this account
 during the development prossess, should I use it to
 commit all my changes to the main brange, or should
 I make a personal brange just for my work on the
 camera module. Can I use my github account instead,
 if so, what must I do with the changes and bug
 fixel to the main pygame development brange.


 You might want to work on the main trunk, or not... depending on a number of
 things.

 Either a separate branch or in your git hub is probably a good way to go.
 If you put things in svn, then it's easier for some of the pygame developers
 to watch your work, and maybe even make changes.  However it's up to you.

 Best to merge your work in occasionally into a svn branch at least.   Or
 send the mailing list a link to your work when you've committed something
 you'd like people to look at or merge in.

 Then when your work is getting along, talk about merging it into the trunk
 with the mailing list and other developers.  If no one has changed any of
 the files you have changed, then it's probably ok.

 Working in the trunk lets you take advantage of some other things... like
 the build bots which build on mac/win python2.4 python2.5 python2.6 and run
 the tests for you.  So it can save you a lot of testing work.

 Say you wanted to make some changes to surface.c and a bunch of others that
 aren't part of the camera module directly, and didn't commit to trunk for a
 few weeks... there's a good chance someone else might make changes to those
 files.

 As long as you communicate with other devs what your working on it should be
 fine.