[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
subsurfaces origin attribute Re: [pygame] PixelArray question
- To: pygame-users@xxxxxxxx
- Subject: subsurfaces origin attribute Re: [pygame] PixelArray question
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Fri, 24 Aug 2007 14:16:48 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 24 Aug 2007 00:17:04 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=HlZp/OMA6Xs58R+4gYJqGNYSLzAoyW6hJK2jbhzcO3f2xTfNJDH+3yLnA54TqRJDAz15tiNoD/f2z0kEhfLyIIkHkHRp7yUT/ichXN6nJjgEoXSYFgkjbdZ0ySRAzTUlVwUpYRdGee5eoWyEMkQvkVbrMC3wjYxzsS1GloWVzgA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ZKxjRXxVLANWGr6+geiOdYIdbQ6wYFxRfjg6SgOkZaUUFm1s3JfxWZl4FcHpnNWKEjoGToMKrdbbxZIvxs6ME4Pd8jLVJiZz4hUlA537k2nlNcUmT0h3zoT5FF8EgIc+sFKbkO25P6Ttl2ib6qN8jp46/WbzifPTrXV1rNsf+ro=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
I'm not sure I understand how that would work? Could you please
explain it with code?
I think it sounds useful though - just not sure I understand.
On 8/24/07, Greg Ewing <greg.ewing@xxxxxxxxxxxxxxxx> wrote:
> Lenard Lindstrom wrote:
> > As for slicing, that is just a generalized form of Surface.subsurface
> > (with the parent locked for consistency with surfarray).
>
> Speaking of subsurfaces, there is one thing that I wish
> they had, and that's the ability for the origin of the
> subsurface's coordinate system to be somewhere other than
> its top left corner.
>
> This would have been useful in a small GUI library I wrote
> recently, where to draw a subwidget I get a subsurface from
> the parent widget's surface and pass it to the subwidget's
> draw() method. But this means that a subwidget can't hang
> outside the bounds of its parent widget, as that causes
> subsurface() to throw a wobbly.
>
> If surfaces had an "origin" attribute, subsurface() could
> simply clip the subsurface and set its origin appropriately.
>
> --
> Greg Ewing, Computer Science Dept, +--------------------------------------+
> University of Canterbury, | Carpe post meridiem! |
> Christchurch, New Zealand | (I'm not a morning person.) |
> greg.ewing@xxxxxxxxxxxxxxxx +--------------------------------------+
>