[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Difficulty with Surface.set_clip()



Pete Shinners -- Mercredi 23 Mai 2001 00:13:
> > I now have a mostly-working mini-map. It does not let you browse around
> > yet, but it shows a properly scaled-down version of the main map. In
> > addition, it shows a white rectangle highlighting the on-screen portion
> > of the map.
>
> ok, i'm trying to make sure i understand what your code is trying
> to do. to me it looks like the problem is you are setting the clip
> area on the source surface, that's not right :]
>
> you want to use Surface.set_clip() on the destination, then
> blits/fills/draws can only happen inside that clipped area.
> to me it looks like what you are trying to do is blit only
> a portion of the source onto the destination. the Surface.blit()
> function takes an optional third Rect argument which specifies a
> sub-region of the source to use in the blit.

Right. I knew I had to be doing something wrong. :-) Thank you very much!

I just tried what you suggested, and it works. I have to go to bed now, but I 
promise screenshots of the mini-map soon. :-)

Cheers,

Jérôme

>
>
>
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org

-- 
Jérôme Loisel, étudiant et webmestre
Lévinux: GNU/Linux pour la communauté
http://www.levinux.org/
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org