Hugo, logicalSurface is an object that contain pygame
surface I am drawing everything on it and blitting this surface to the pygame screen. I haven’t locked the surface
anywhere else, all the others drawing function working fine only blit function gives
the problem if and only if I draw the pages quickly by pressing pageUp and pand
pageDown. I have temporary fixed this problem like
this, but I want a better solution def blit(self,screen, logicalSurface,
(offsetX,offsetY)):
"""
blit the surface on to the pygamewindow, logicalSurface -> pygame surface
"""
try:
screen.blit (logicalSurface.surface, (-offsetX, -offsetY))
except:
time.sleep(0.1)
self.blit(screen, pygameSurface,(offsetX, offsetY)) Thanks, Sibtey On Behalf Of Hugo Arts What exactly is the
difference between logicalSurface and logicalsurface.surface? in draw(), you
draw directly on logicalSurface. But after that you blit logicalSurface.surface
to the screen. On Fri, Jun 27, 2008 at 11:16 AM, Sibtey Mehdi <sibteym@xxxxxxxxxxxxxx> wrote: I am using 1.8.0 packages (march 29
2008). On page Up and Page Down I am calling the drawPage() function. def drawPage(self, page,
logicalSurface):
self.draw(page,
logicalSurface)
self.screen.blit (logicalSurface.surface, (-offsetX, -offsetY)) def draw(self, page, logicalSurf): #draw rect for rec in
page.rects:
self.Pygame.draw.rect(logicalSurf,rec.color,(rec.x1,rec.y1,rec.x2,rec.y2), 1) #text for text in
page.texts:
#draw text #lines for line
in page.lines:
self.Pygame.draw.line(logicalSurf,
[line.colline.x1,line.y1],[line.x2,line.y2],1)
thanks, Sibtey Are you using svn pygame? There have been some changes since
1.8.0 to the locking code. Hugo Arts wrote: > well, if pygame says this is a locking issue, then it is
most likely a > locking issue. If you say unlocking the surface did not fix
the problem as > you said, I don't have another solution with the current
supplied > information. > > We'll likely need to see some code before we can figure out
the actual > error. > > Hugo > > On Fri, Jun 27, 2008 at 8:54 AM, Sibtey Mehdi <sibteym@xxxxxxxxxxxxxx> > wrote: > > >> Hi >> >> I am drawing some graphics page (Text, rect, lines,
polygon) on pygame >> surface, but when I quickly pressing page up and page
down my application >> give the Pygame error "Surfaces must not be locked
during blit". >> >> I have also unlocked the surface by suface.unlock
before blitting but it >> doesn't solve the problem. >> >> So please help me out of this problem >> >> >> >> Thanks, >> >> Sibtey >> >> >> >> > > |