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

[pygame] Difficulty with Surface.set_clip()




Hello Folks!

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.

I use the following code to blit my map onto the screen:

def blit_fsem(screen, fsem_obj, tiles, metadata):
    clip = pygame.Rect(600, 200, 600, 600)
    fsem_obj.surface.set_clip(clip)
    # The following updated the minimap with the white rectangle.
    fsem_obj.minimap = fsem_obj.return_minimap()
    screen.blit(fsem_obj.surface, (0, 0))
    screen.blit(fsem_obj.minimap, (610, 10))
    return

The problem is, despite the set_clip(), the whole map always gets blitted. I 
know that the set_clip() properly sets the clip because I can see the white 
rectangle in its proper position. (The white rectangle is drawn from get_clip 
information.) But the whole surface is blitted, and from (0, 0) instead of 
from (600, 200).

Any clues? Am I doing something wrong again?

Cheers,

Jérôme Loisel


PS: Pete: Thanks for the information on the CVS version. I will try CVS 
Pygame sometime soon.

-- 
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