你如何在 pygame 屏幕上放置文本? [英] How do you put text on a pygame screen?
本文介绍了你如何在 pygame 屏幕上放置文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在制作一个游戏,我希望左上角有一个分数.我如何将文本放在那里,我可以让它成为一个变量吗?我试过在网上查找,但我所看到的一切都太混乱了.
I am making a game and I want there to be a score at the top left. How would I put text up there and can I make it a variable? I have tried looking online but everything I've seen is way too confusing.
推荐答案
你可以这样做 -
text = font.render('Text', BackGround(T or F), ForeColor (or Font Colour), Background Color)
这篇关于你如何在 pygame 屏幕上放置文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文