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

[pygame] Re: overlayed text




Pete Shinners writes:

> hiya etoffi. we've got a pygame mailing list, which would be a great
> place if you want to follow this up any further :]
> http://www.seul.org/archives/pygame/users/

done and done. although nntp is *so* much nicer.

> > for some reason i cant get text written over a white background:
> > here is (almost) the code i have now:
> > (written with pygame, but basically the same)
> >
> > text = self.font.render(self.name, 1, (255, 0, 0))
> > self.owner.frame.background.fill ((255,255,255),  [0, 0, 640, 60])
> > pygame.display.update ()
> > self.owner.frame.background.blit (text, (1,1))
> 
> 
> your problem here is that your are blitting the text _after_ you
> update the display. swap those last two lines around.

i put in the update _after_ it didnt work 6 times ;)

> also, if the background is solid white, your performance will be much
> better off sending that white background color to the font render function.
> 
> text = self.font.render(self.name, 1, (255, 0, 0), (255, 255, 255))
> 
 
thanx. also note that i wanted a white "stripe" over the top of the screen.

--
etoffi <http://oluworld.sourceforge.net/>

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