At the moment we have 1 python script with everything in. The HUD its self is about 20 lines of code!!!

Is there anyway we can put this code in a separate .egg(?) file & include this as a single line of code? similar to the includes of c++ i suppose…

HUD = loader.load HUD.egg

was hoping for something like that anyway…


Hmm, why an egg file? Wouldn’t you want to import it as a module?

There’s a tutorial that pretty much explains how to do the basics in python here: http://docs.python.org/tut/node8.html

That might not get the job done, so how about checking out air blade or some other examples lying around the forum? Tons of different ways of doing it, and it seems to be a matter of preference as far as I can tell. Maybe take a look at a couple of different ones and see which one suits your style. I can’t exactly direct you to any single one at this point, seeing as I don’t know what yours needs are.

Not very familiar with how includes work in C++, so I’m not sure if that’s what you meant.

BTW: Did a quick search and these guys HERE: https://discourse.panda3d.org/viewtopic.php?t=3916&highlight=gui
discuss their own preferences (it’s a small discussion, however). The point is, treeform gave an example of how he has done it in the past.

thank u :slight_smile: