I am having a strange problem with using buttons. This is my code to show a button:
lumberMillImage = loader.loadModel("Images/lumberMillButton");
self.lumberMillButton = DirectButton(geom = (lumberMillImage.find('**/lumberMillButton'),
lumberMillImage.find('**/lumberMillButton'),
lumberMillImage.find('**/lumberMillButton'),
lumberMillImage.find('**/lumberMillButton')),
relief=None, command=self.BuildBuilding, extraArgs=["LumberMill"]);
self.lumberMillButton.reparentTo(aspect2d);
self.lumberMillButton.setPos(1.1, 0, -.55);
It was all working fine until I tried to use a different button with it. I am creating the button using this command line text:
egg-texture-cards -o lumberMillButton.egg -fps 0 -p 256,256 LumberButton.png
The error I get is:
hunterLoungeImage.find('**/huntersLoungeButton')), relief=None, command=self.BuildBuilding, extraArgs=["HuntersLounge"]);
File "C:\Panda3D-1.5.4\direct\src\gui\DirectButton.py", line 62, in __init__
self.initialiseoptions(DirectButton)
File "C:\Panda3D-1.5.4\direct\src\gui\DirectGuiBase.py", line 241, in initialiseoptions
func()
File "C:\Panda3D-1.5.4\direct\src\gui\DirectFrame.py", line 132, in setGeom
sort = DGG.GEOM_SORT_INDEX)
File "C:\Panda3D-1.5.4\direct\src\gui\DirectGuiBase.py", line 561, in createcomponent
widget = apply(widgetClass, widgetArgs, kw)
File "C:\Panda3D-1.5.4\direct\src\gui\OnscreenGeom.py", line 49, in __init__
self.setGeom(geom, parent = parent, sort = sort, color = color)
File "C:\Panda3D-1.5.4\direct\src\gui\OnscreenGeom.py", line 96, in setGeom
self.assign(geom.copyTo(parent, sort))
AssertionError: !is_empty() at line 461 of panda/src/pgraph/nodePath.cxx
Like I said, this still works if I use the old .egg image I created but it will not work when I create a .egg with a new image. If you need to see them, these are the images I am using and their corresponding .egg files
Old working files - mediafire.com/?sharekey=14d0 … 6e282a0ee8
New non-working files - mediafire.com/?sharekey=14d0 … 49b5870170
Thanks for any help you may be able to give.
[/code]