[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: Fwd: [pygame] font/text in pygame
> 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 )