From nothing my game started to crash D: it seems there is a error when I call setPixelsPerUnit on my font.
Here is the traceback
C:\Documents and Settings\Lap1994\Desktop\Games\Magical dice 3d>DirectStart: Sta
rting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Assertion failed: get_num_pages() == 0 at line 75 of c:\panda3d-1.7.0\panda\src\
text\dynamicTextFont.I
Traceback (most recent call last):
File "main.py", line 24, in checkScene
self.changeScene(self.scene.change)
File "main.py", line 34, in changeScene
self.scene = EndlessScene(*self.scene.args)
File "C:\Documents and Settings\Lap1994\Desktop\Games\Magical dice 3d\MagicalD
ice\sourcecode\endlessscene.py", line 46, in __init__
self.setupHud()
File "C:\Documents and Settings\Lap1994\Desktop\Games\Magical dice 3d\MagicalD
ice\sourcecode\endlessscene.py", line 181, in setupHud
self.lightFont.setPixelsPerUnit(60)
AssertionError: get_num_pages() == 0 at line 75 of c:\panda3d-1.7.0\panda\src\te
xt\dynamicTextFont.I
:task(error): Exception occurred in PythonTask Check scene changes
Traceback (most recent call last):
File "main.py", line 132, in <module>
run()
File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
self.taskMgr.run()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
self.step()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
self.mgr.poll()
File "main.py", line 24, in checkScene
self.changeScene(self.scene.change)
File "main.py", line 34, in changeScene
self.scene = EndlessScene(*self.scene.args)
File "C:\Documents and Settings\Lap1994\Desktop\Games\Magical dice 3d\MagicalD
ice\sourcecode\endlessscene.py", line 46, in __init__
self.setupHud()
File "C:\Documents and Settings\Lap1994\Desktop\Games\Magical dice 3d\MagicalD
ice\sourcecode\endlessscene.py", line 181, in setupHud
self.lightFont.setPixelsPerUnit(60)
AssertionError: get_num_pages() == 0 at line 75 of c:\panda3d-1.7.0\panda\src\te
xt\dynamicTextFont.I
:TaskManager: TaskManager.destroy()
And here is the code
self.lightFont = loader.loadFont("assets/cpmonolight.otf")
self.lightFont.setPageSize(512,512)
self.lightFont.setPixelsPerUnit(60)
self.boldFont = loader.loadFont("assets/cpmonobold.otf")
self.boldFont.setPageSize(512,512)
self.boldFont.setPixelsPerUnit(60)
I’m using 1.7