[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Gradient Algorithm
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Gradient Algorithm
- From: DR0ID <dr0id@xxxxxxxxxx>
- Date: Thu, 05 Oct 2006 15:08:33 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 05 Oct 2006 09:07:23 -0400
- In-reply-to: <c3f69bf60608101128h30d1de20i3bc7edec2810e83b@mail.gmail.com>
- References: <64F7B8E2954C73499806C1E59A848C1D0AEC1949@CHICAGO-EX1.chicago.midway.com> <44D8FEE8.8020201@xepher.net> <c3f69bf60608101128h30d1de20i3bc7edec2810e83b@mail.gmail.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
- User-agent: Thunderbird 1.5.0.7 (Windows/20060909)
Patrick Mullen schrieb:
Could you modify it so that it can handle horizontal or diagonal
gradients as well? Horizontal is easy, I'm not sure about diagonals
though. I guess you would have to increment y and x by their own
separate speed for each iteration and then draw a line from 0,y to
x,0. But that only works for top-left to bottom-right diagonals. I
guess it needs a special case for all 4 diagonals, and horizontal, and
vertical :)
Hi
I wrote some gradient code (well its a bit slow, in return you can do
some different things like round gradients). It doesn't use numeric,
only pure python and pygame.
I wanted to add it to the libraries section of the pygame site this
morning, but I couldn't submit it (as known, there are some problems
submitting projects at the moment). I think its too big for the cookbook
section.
You can find it in the pygame section here:
http://mypage.bluewin.ch/DR0ID/
Enjoy!
As usual, I'm open to suggestions. :-)
~DR0ID