.Egg image and button?

Hi everyone!

This is my second post in the same week and that’s because I’m learning panda3d full time in preparation for a big project. Here is my question: 8)

I download a demo game that a found here called “spaceFlight”. You can find it easily with the research in the forum.

For the menu, the programmer creates the background image and the button with .egg. I’m not sure I understand why :laughing: . There is no other way in Panda to load jpg or bmp than egg? Maybe there is something I don’t understand here because after my reading I tough that .egg where models or actor to play with.

Second point, if this is the only way, how can I create them easily because I don’t know anything at 3d studio max or maya. I have maya on my computer but I’m very scared to use it because I’m not an artist, i’m a programmer!

Thanks in advance for you answer!


Panda3D can load several image formats, such as for example jpg, bmp, tga, png, you name it.
You can load those by just specifying your files in loader.loadTexture.
Though, there are ways to convert your jpg/png/tga to a .egg file. I don’t know why that is, but it’s just an additional way to store your image. Other formats are fine too.
.Egg files are normally for models, indeed, in your case they probably made 1 polygon (the button) with the texture on it. That makes it easier for you to put the menu in the game:

menuButton.reparentTo(aspect2d) #or render2d, so you like
menuButton.setScale(0.2) #make it some smaller
menuButton.setPos(0,0,0.3) #put it somewhere on the screen

You can also pass this model as geometry for DirectGui items.
For example, in DirectButton it requires an egg file with the different states of the button in it. Those .eggs are converted by a converter.

These days, you have to be ready to be everything you need.
Since you already have Maya, I think you’re very set to move on. IMO, Maya has the most intuitive interface than other packages I’ve ever used (I love the mouse gesture, it saves a lot of time). And the additional good thing is v8.5 also supports Python script next to the old MEL script.
I’d recommend to finish watching the movie tutorials.

For menus or dialogs, I’d like to use my own buttons :