Hi - I’m trying to create a DirectButton for a login screen. I want to use 4 separate images for the various button states, and I tried to follow the directions given in the Panda manual. I used egg-texture-cards to create an egg with all four images (.jpg’s) and then wrote the following code:
# Add a button graphic to cover the cruddy popup marker
maps = loader.loadModel('LoginListButton.egg')
jobListButton = DirectButton(relief = None,
geom = (maps.find('arrow_ready'),
maps.find('arrow_press'),
maps.find('arrow_rollover'),
maps.find('arrow_disabled')),
geom_scale = (geomScale, geomScale,
geomScale),
frameSize = (0, w, -0.2, 0.9))
When I run my program, I receive the following error:
C:\_code\Panda\InterfaceTest>ppython InterfaceTest.py
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
Assertion failed: !is_empty() at line 429 of panda/src/pgraph/nodePath.cxx
Traceback (most recent call last):
File "InterfaceTest.py", line 261, in ?
interface = InterfaceTest()
File "InterfaceTest.py", line 54, in __init__
self.initLoginScreen()
File "InterfaceTest.py", line 117, in initLoginScreen
fieldLong)
File "InterfaceTest.py", line 234, in createLoginList
frameSize = (0, w, -0.2, 0.9))
File "C:\Panda3D-1.0.5\direct\src\gui\DirectButton.py", line 61, in __init__
self.initialiseoptions(DirectButton)
File "C:\Panda3D-1.0.5\direct\src\gui\DirectGuiBase.py", line 236, in initialiseoptions
func()
File "C:\Panda3D-1.0.5\direct\src\gui\DirectFrame.py", line 118, in setGeom
sort = GEOM_SORT_INDEX)
File "C:\Panda3D-1.0.5\direct\src\gui\DirectGuiBase.py", line 556, in createcomponent
widget = apply(widgetClass, widgetArgs, kw)
File "C:\Panda3D-1.0.5\direct\src\gui\OnscreenGeom.py", line 49, in __init__
self.assign(geom.copyTo(parent, self.sort))
File "NodePath", line 12387, in copyTo
File "NodePath", line 1260, in __overloaded_copyTo_ptrConstNodePath_ptrConstNodePath_int
AssertionError: !is_empty() at line 429 of panda/src/pgraph/nodePath.cxx
If I change the button’s ‘geom’ parameter to simply:
geom = maps,
then the buttons appear, but the textures constantly cycle through the 4 packaged in the egg.
Can anyone tell me what I’m doing wrong? Thanks for you help!
- Ogel