[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Polygon Area Calculation?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Polygon Area Calculation?
- From: "Nirav Patel" <olpc@xxxxxxxxxxxxxx>
- Date: Tue, 30 Sep 2008 00:32:46 +0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Mon, 29 Sep 2008 15:32:52 -0400
- 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=97O3onp7t1bVvZAmQJeRAjl4jdnaYLw0kzwbsEQQp8Y=; b=sm97js6/zqe0p90iXM9DLwxHZGVVVafpZSn11+kCPzrjEqQhD1YasaIaIm3QrxCXwL kyeqiP9LIn3Cy2bWACpEie22MNqD0SIMCkw78iPQwLg8Wq5jkrQTysJpeQmfQLwwG5W2 oMQR0Y+5RMTDF7k4GS16gjR5v7qVuEA6ixmI4=
- 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=p2PxaYvdnxfz5XgDX6vgwiZB8+MsvxnUTeD0M88bh/Xi/qO9hvhxGytrubkne5NoGV 2I22u6VLzH9+ZOjZv0H9a4y/vlQZ9uCQL428Gk13qJeH5WLh35SAMshMWNmJbwBXkImc mr05A4axAkVkObDk27oefLH8wwMVXa747y4Cc=
- In-reply-to: <217c8c050809290857h53a543a2gbc5716cdb1f04c5a@xxxxxxxxxxxxxx>
- References: <217c8c050809290857h53a543a2gbc5716cdb1f04c5a@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
In Pygame SVN, there are new Mask functions. You could turn the
polygon surface into a mask with mask.from_threshold() or
mask.from_surface(), and then get the size in pixels with
mask.count().
Nirav
On Mon, Sep 29, 2008 at 8:57 PM, Mark S <slygroups@xxxxxxxxx> wrote:
> Hi all,
>
> I'm wondering if there is anything built in to pygame that will report the
> area of a polygon?
>
> Thanks,
>
> mark