[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] get coluor of a sprite
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] get coluor of a sprite
- From: "Nirav Patel" <olpc@xxxxxxxxxxxxxx>
- Date: Sat, 27 Dec 2008 00:17:40 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 27 Dec 2008 00:17:51 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=IPHnqphutUiSxvdQIMwT2Ofq88YmnBA42YnN5UOujfU=; b=pqXOAIC9zZXYkVdfDvbbdkNmX1gg2ks/BdLodzojyEx2mRkrcTPN04tgvLtsHMqBl5 iVwG1wLxbtvrFlX0uHdyO0umT3Uy6w88oK1JO7IhwYsvuWF5FltO3Cp0IzqVmlIFJDxc CEZYa0Af+Q64SlZVxA34niOxS34X7zhXC4z6M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=nATWrcjlJc/D0duzIIPnZXEt1uTlBtJy8klVMGxQ+MSNqLniQaCN8lY8eLApY0uLGC D364+eMEfZa6JZRZpy9BnLSdACN3NUtWNF4DTg/HkT47Y/GN8z+hydc9IiHUxgJUw8at Ae1gblGYpYUYaAhJRVTD72Hx7SIUXsC+/9zf8=
- In-reply-to: <20081227024446.5D2454476A@xxxxxxxxxxxxxxxxxxxxxx>
- References: <20081227024446.5D2454476A@xxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
There is an average_color function in the transform module in Pygame SVN.
On Fri, Dec 26, 2008 at 9:44 PM, yanom @linuxmail.org
<yanom@xxxxxxxxxxxxx> wrote:
> if you wanted to get the overall average color of a sprite, you would have to use a for loop to go through all the pixels and count the pixels of each color or something
> ----- Original Message -----
>> From: "Aaron Maupin" <maupin@xxxxxxxxxxxxxx>
>> To: pygame-users@xxxxxxxx
>> Subject: Re: [pygame] get coluor of a sprite
>> Date: Sat, 27 Dec 2008 05:22:12 +0900
>>
>>
>> Gonzalo Castro wrote:
>> > What function may I use to get the colour of a sprite?
>>
>> Very easy. Use Surface.get_at((x, y)) where x and y equals the
>> pixel in the surface you want to check the color of.
>>
>> http://www.pygame.org/docs/ref/surface.html#Surface.get_at
>
>>
>
>
> =
> Military Relocation Service
> Jan and Mary Team get you moving. Professional Real Estate Services.
> http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=e12ad774014ddc03c02fb38da65ab85a
>
>
> --
> Powered by Outblaze
>