Re: [pygame] antialiased circles

2010-03-03 Thread René Dudfield
Hi,

please see:  pgyame.gfxdraw.aacircle(surface, x, y, r, color): return None

cheers,

On Wed, Mar 3, 2010 at 1:33 AM, Luke Paireepinart
rabidpoob...@gmail.com wrote:

 I'd like to draw antialiased circles but it doesn't seem to be included in 
 Pygame.    Is this feature included in Pygame 2?

 I found an example for drawing antialiased circles by using a bunch of AA 
 lines but it was pretty slow and also didn't fill in the circle.
 What would you guys recommend I do?  The last post I found on this was that 
 SDL_GFX contains an AACircle method but it's not exposed.
 I don't think PIL can draw antialiased circles either.

 I can pre-generate the images for the most part so it doesn't matter too-too 
 much if it's slow (won't affect runtime performance), but it would help to 
 speed up the pre-generation.  I can just store them on disk but it will take 
 up more space than I'd like.  So I have alternate solutions that I can use 
 already, I just thought someone might have a quick fix that I just hadn't 
 thought of.

 Hmm, it just occurred to me that I could render a circle at double or triple 
 the resolution then do a bicubic resampled rotozoom, that would antialias it, 
 wouldn't it?  Would that antialias still work if the background were Alpha? 
 (i.e. does rotozoom interpolate alpha when it resizes?)  I'll investigate 
 this, but still send this post in case anyone has some insight.

 Thanks for your time guys!
 -Luke


Re: sprites... Re: [pygame] Google Summer of Code 2010 is coming

2010-03-03 Thread Nikhil Murthy
Thank you for telling me. As far as possible I just wanted to use the old
sprite code. What I thought I would do is try to build these as
enhancements, rather than replacements, to the existing sprite system, so
that they can be easily plugged in or out. In a few days, I will finish one
of the modules as an example.

Nikhil Murthy

On Tue, Mar 2, 2010 at 12:50 PM, René Dudfield ren...@gmail.com wrote:

 Hi,

 just a note... Jason M. Marshall has recently been working on the sprite
 code.  That doesn't stop you of course, just to note that he has been
 working on it.

 I think his plans are to complete the unit tests, and to work on
 optimisations.

 cheers,




 On Sun, Feb 28, 2010 at 7:20 PM, Nikhil Murthy murthyn...@gmail.comwrote:

 I wish to take up improving the sprite and scene system of pygame, and the
 following is my proposal.

 About Me:

 Name: Nikhil Murthy
 E-mail address: murthynik...@yahoo.com, murthyn...@gmail.com
 Time Zone: IST (GMT+5:30)
 Preferred Language: English
 Other Time Commitments: None
 Pygame Experience:
 - Prototypes for 6 different games, one of which won a prize.

 http://www.gamecareerguide.com/features/581/results_from_game_design_.php?page=1
 Programming Experience:
 - Summer internship with Dhruva, a Bangalore-based video game company.
 - An economic simulation for a professor of my college
 - The registration software of the Department of Controls of my college.

 About My Project:

 What I wish to do is improve the sprite and scene system of pygame. The
 aims I wish to achieve are:
 - Provide a highly flexible set of utilities for quickly making games with
 pygame.
 - Have every component be easy to remove and replace by a user written
 module.

 To do this, I will make modules for the following basic components of
 games:

 - Views: Parts of the screen which display different logical parts of the
 game
 - Game spaces: For collision detection.
 - Game states: To keep track of the state of running of the game so as to
 easily and reversibly alter state.
 - Images: To make resources more natural to deal with and provide a common
 base so that using a rabbyt back-end can be done without changing any game
 code.

 These are the components I always felt to be lacking in pygame, and that I
 feel will be of use in almost every game, so I would like to work on these.

 For each of these modules, I will:

 - Write and submit the implementation
 - Test against a number of unit tests and as a component of a small game.
 - Document every class and function.
 - Present the test game as an example of best practices with the module.

 Nikhil Murthy


 On Fri, Feb 26, 2010 at 3:13 AM, Marcus von Appen m...@sysfault.orgwrote:

 Hi,

 as you might have already seen, the Google Summer of Code 2010 is coming
 and the PSF will apply as mentoring organisation again this year.
 Taking up the ball, I think, it would be great to have another Google
 Summer of Code for Pygame.

 Since we had a good success with the last ones and all mentees did a
 great job so far, with lots of new stuff being contributed and quite
 some fun, it would be nice to participate again.

 I'll be definitely up for mentoring this year (with less time to spend,
 but even more motivation :-), though I personally would not want to have
 Pygame trying to apply as own organisation this year. We failed last
 year and Arc Riley from the PSF did a great job to manage anything for
 participating projects under the PSF umbrella.  It is more likely that
 we will participate successfully with the PSF, especially since we would
 have more time to manage the student's work, which otherwise would have
 to be spent on administering.

 Anyways, volunteers, students, interested mentors, core devs and anyone
 else, get ready, fasten your seat belt and bring up your own ideas to
 have another great coding season.

 Interested students can find the ideas page for pygame as well as more
 information regarding the summer of code in the pygame wiki:

http://pygame.org/wiki/gsoc2010ideas

 The ideas are only ideas, not guidelines to what will be accepted. If
 you have an own idea for Pygame, feel free to post it to the mailing
 list and let's discuss it.

 Regards
 Marcus






Re: [pygame] Unprintable characters

2010-03-03 Thread B W
Clean slate.

UniCode does not seem to be completely functional in SDL. As this thread
from 2006 suggests (
http://old.nabble.com/Arrow-Keys,-and-keysym.unicode,-SDL-1.2.10-td5030718.html)
you may need to do some platform-specific special handling of certain
keyboard events. The SDL version used in Pygame may have changed in the last
four years, but the behavior does not indicate so. Of course, there is still
the possibility that I am a floundering UniCode noob. I'm sure one of the
Pygame devs could clarify.

Check this out.

##begin python##
import unicodedata
import pygame
from pygame.locals import KEYDOWN
pygame.init()
pygame.display.set_mode((10,10))
while 1:
for e in pygame.event.get():
if e.type == KEYDOWN:
print 'key', e.key
print 'unicode len', len(e.unicode)
print 'unicode name', unicodedata.name(e.unicode, 'no name')
print '--break--'
##end python##

The following output is on a Compaq 6910p Windows XP laptop, Python 2.5.4,
Pygame 1.9. I can't explain why Python's name lookup is failing on a
carriage return, or why the two Intel platforms I have access to (Windows
and Ubuntu) return an event.key that is greater than an 8-bit value for
cursor keys.

##begin program output##
key 32
unicode len 1
unicode name SPACE
--break--
key 13
unicode len 1
unicode name no name
--break--
key 273
unicode len 0
unicode name
Traceback (most recent call last):
  File C:/tmp/unicode.py, line 11, in module
print 'unicode name', unicodedata.name(e.unicode, 'no name')
TypeError: need a single Unicode character as parameter
##end program output##

A Ubuntu 8 Compaq desktop, Python 2.5.2, Pygame 1.7.1, produces the same
results.

Gumm


Re: [pygame] antialiased circles

2010-03-03 Thread Luke Paireepinart
gfxdraw is from pygame2, I assume?
Thanks Rene, I'll give it a try.  Pygame2 looks quite awesome.  Is the 1.9
branch gonna keep being maintained when pygame2 is official?  it breaks
backwards compatibility, I guess, are you just going to keep it with a
different name so they can be installed together?

On Wed, Mar 3, 2010 at 2:41 AM, René Dudfield ren...@gmail.com wrote:

 Hi,

 please see:  pgyame.gfxdraw.aacircle(surface, x, y, r, color): return None

 cheers,

 On Wed, Mar 3, 2010 at 1:33 AM, Luke Paireepinart
 rabidpoob...@gmail.com wrote:
 
  I'd like to draw antialiased circles but it doesn't seem to be included
 in Pygame.Is this feature included in Pygame 2?
 
  I found an example for drawing antialiased circles by using a bunch of AA
 lines but it was pretty slow and also didn't fill in the circle.
  What would you guys recommend I do?  The last post I found on this was
 that SDL_GFX contains an AACircle method but it's not exposed.
  I don't think PIL can draw antialiased circles either.
 
  I can pre-generate the images for the most part so it doesn't matter
 too-too much if it's slow (won't affect runtime performance), but it would
 help to speed up the pre-generation.  I can just store them on disk but it
 will take up more space than I'd like.  So I have alternate solutions that I
 can use already, I just thought someone might have a quick fix that I just
 hadn't thought of.
 
  Hmm, it just occurred to me that I could render a circle at double or
 triple the resolution then do a bicubic resampled rotozoom, that would
 antialias it, wouldn't it?  Would that antialias still work if the
 background were Alpha? (i.e. does rotozoom interpolate alpha when it
 resizes?)  I'll investigate this, but still send this post in case anyone
 has some insight.
 
  Thanks for your time guys!
  -Luke



Re: [pygame] antialiased circles

2010-03-03 Thread Marcus von Appen
On, Thu Mar 04, 2010, Luke Paireepinart wrote:

 gfxdraw is from pygame2, I assume?
 Thanks Rene, I'll give it a try.  Pygame2 looks quite awesome.  Is the 1.9
 branch gonna keep being maintained when pygame2 is official?

Yes. Currently there are no plans to drop pygame.

 it breaks
 backwards compatibility, I guess, are you just going to keep it with a
 different name so they can be installed together?

They already use different names, (pygame -- package pygame, pygame2 --
package pygame2), so they can be installed at the same time without
influencing each other.

Regards
Marcus


pgpnr4kni8rfK.pgp
Description: PGP signature


Re: [pygame] antialiased circles

2010-03-03 Thread René Dudfield
On Thu, Mar 4, 2010 at 2:48 AM, Luke Paireepinart
rabidpoob...@gmail.com wrote:
 gfxdraw is from pygame2, I assume?
 Thanks Rene, I'll give it a try.  Pygame2 looks quite awesome.  Is the 1.9
 branch gonna keep being maintained when pygame2 is official?  it breaks
 backwards compatibility, I guess, are you just going to keep it with a
 different name so they can be installed together?


No need to use pygame2 for gfxdraw, it's in pygame.

yeah, pygame is still going.  But might be renamed to pygame10... or pygame12 ;)


Re: [pygame] Code review for Pygame2 example

2010-03-03 Thread Luke Paireepinart
Hi,
I tried your example and it doesn't work.  Python exits abnormally and
Windows 7 pops up with a message saying would you like to end the program
Python or whatever.  No traceback.  Any ideas?

On Tue, Mar 2, 2010 at 12:12 PM, Evan Kroske e.kro...@gmail.com wrote:

 Last year, I tried to create a large example game to demonstrate several of
 Pygame2's features. In retrospect, I should have created lots of independent
 examples, each demonstrating one function of Pygame2, but I chose instead to
 show them all at once. Here's the resulting example:
 http://pygame2examples.googlecode.com/files/pygame2alien.tar.gz. It's
 based on the oldalien.py example from the original Pygame, but I tried to
 abstract the graphics from the rest of the game. The result is a quagmire of
 poorly-applied design patterns; nevertheless, it runs and shows off several
 features of Pygame2. Should I try to salvage it by tying it to one graphical
 skin, or should I ditch it?

 --
 Evan Kroske
 http://welcome2obscurity.blogspot.com/
 The personal blog of Evan Kroske,
 novice software developer.