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

Re: Fwd: [pygame] font/text in pygame



Dan:
Firefox is so vastly better than Explorer; it's the main thing I miss
about my computer when I'm at school. (have to use IE at school.)

On 4/28/05, Dan <dan@xxxxxxxxxxxxxxxx> wrote:
> > text_score = font.render("%d" % (score), 1, (255, 255, 255, 0))
> > TypeError: int argument required
> >
> > But why would it be requiring an int? font.render has to take a string...?
> 
> Yes, but "%d" takes an int (decimal). Change it to:
> 
>   font.render("%s" % (score), ...)       # %s takes string
> 
> Or better yet:
> 
>   font.render(score, ...)
> 
> --
>   [Mozilla] Firefox is better than Explorer by leaps and bounds. I
>   don't miss Explorer one iota. Give Firefox a day's worth of Web
>   surfing, and you won't either.
>       - Forbes (short link: http://tinyurl.com/56j8m )
> 
>