第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

pygame.error: font not initialized 如何修復(fù)?

pygame.error: font not initialized 如何修復(fù)?

猛跑小豬 2023-04-25 17:11:41
所以我有這個(gè)錯(cuò)誤 pygame.error: font not initialized 我已經(jīng)厭倦了通過(guò)縮進(jìn)它來(lái)修復(fù)它,未識(shí)別它,更改字體和其他東西但它仍然無(wú)法在我的 STARTMENUE 上工作。我也嘗試過(guò)使用另一種字體,認(rèn)為這是問(wèn)題所在,但事實(shí)并非如此。我有問(wèn)題嗎largeText = pygame.font.Font('freesansblod.ttf',115)我的完整代碼import pygame#set screenwindow = pygame.display.set_mode((500,500))#set Namepygame.display.set_caption("Noob")class Player:    def __init__(self,x,y,height,width,color):        self.x = x        self.y = y        self.height = height        self.color = color        self.speed = 0        self.isJump = False        self.JumpCount = 10        self.fall = 0        self.rect = pygame.Rect(x,y,height,width)    def draw(self):        self.topleft = (self.x,self.y)class Floor:    def __init__ (self,x,y,height,width,color):        self.x = x        self.y = y        self.height = height        self.width = width        self.color = color        self.rect = pygame.Rect(x,y,height,width)    def draw(self):        self.topleft = (self.x,self.y)        pygame.draw.rect(window,self.color,self.rect)class Coin():    def __init__(self,x,y,height,width,color):        self.x = x        self.y = y        self.width = width        self.height = height        self.color = color        self.rect = pygame.Rect(x,y,height,width)    def draw(self):        self.topleft = (self.x,self.y)        self.draw.rect(self.color,self.rect)    white = (255,255,255)green = (0,200,0)red = (255,0,0)drakred = (200,0,0)darkgreen = (0,200,0)black = (0,0,0) player1 = Player(50,400,40,40,white)coin = Coin(100,300,30,30,red)floor1 = Floor(0,400,600,30,green)fps = (30)clock = pygame.time.Clock()
查看完整描述

1 回答

?
天涯盡頭無(wú)女友

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超9個(gè)贊

嘗試在導(dǎo)入 pygame 的位置下方添加 pygame.font.init() 。



查看完整回答
反對(duì) 回復(fù) 2023-04-25
  • 1 回答
  • 0 關(guān)注
  • 151 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)