[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] subsurfaces outside of their parents



No, it needs to appear to be 20x20 because the whole idea is to have
whether or not its off the surface to be transparent. This makes it so
code can draw 0, 0, --> 20, 20 on the subsurface without having to
compensate for being off the surface and such... I want this feature,
personally, for a widget drawing system involving subsurfaces.

On 11/8/05, Peter Shinners <pete@xxxxxxxxxxxx> wrote:
> On Tue, 2005-11-08 at 00:46 -0500, Forest Darling wrote:
> > I would like to see a feature where you could have a subsurface take a
> > rect that covered an area that was partially or completely outside
> > parent surface's rect...
> >
> > s = pygame.Surface((100, 100))
> > sub = s.subsurface(Rect(-10, -10, 20, 20)
>
> This has been suggested before. If it is ok for the returned subsurface
> to be smaller than requested, this would be easy to implement. The
> surface would still use the right offset so that drawing to it would
> appear where you expected.
>
> sub = s.subsurface(Rect(-10, -10, 20, 20)
> print sub.get_size()
> (10, 10)
>
> I'll think about it some more, it can lead to strange cases, but for the
> most part I think it would do the right thing.
>
>