我正在尝试为我正在制作的程序制作一些自定义游标,但我得到一个奇怪的错误;这是我使用的游标代码:
arrows = ("XX ",
"XXX ",
"XXXX ",
"XX.XX ",
"XX..XX ",
"XX...XX ",
"XX....XX ",
"XX.....XX ",
"XX......XX ",
"XX.......XX ",
"XX........XX ",
"XX........XXX ",
"XX......XXXXX ",
"XX.XXX..XX ",
"XXXX XX..XX ",
"XX XX..XX ",
" XX..XX ",
" XX..XX ",
" XX..XX ",
" XXXX ",
" XX ",
" ",
" ",
" ")
datatuple, masktuple = pygame.cursors.compile(arrows,black='.', white='X',)
pygame.mouse.set_cursor( (24,24), (0,0), datatuple, masktuple)
它给了我这个错误:
Traceback (most recent call last):
File "C:\Users\user\Desktop\eclipse\programms\src\editor.py", line 30, in <module>
pygame.mouse.set_cursor( (24,24), (24,24), datatuple, masktuple)
pygame.error: video system not initialized
所以我希望有人知道这里的问题是什么,如果你认为这是我的窗户,我仍然使用Windows 7(我不知道有什么问题所以我认为它可能是版本)
答案 0 :(得分:1)
如果你没有打电话
,你会得到那个错误pygame.init()
第一。