Egg convertion???

how does this line work???

egg-texture-cards -o button_maps.egg -p 240,240 button up.jpeg button down.jpeg button dis.jpeg

how do you execute it???

in the command line?

I think you need to clearly your question.

sorry,

um

ok
so i put this line in the coding it saids syntax error???

any one know why???

heres the code>>>

import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *

from pandac.PandaModules import TextNode

#add some text
bk_text = “experimenting with Direct GUIs”
textObject = OnscreenText(text = bk_text, pos = (0.95,-0.95),
scale = 0.07,fg=(1,0.5,0.5,1),align=TextNode.ACenter,mayChange=1)

#callback function to set text
def setText():
bk_text = “Button Clicked”
textObject.setText(bk_text)

egg-texture-cards -o button_maps.egg -p 240,240 button up.jpeg button down.jpeg button dis.jpeg

#add button
b = DirectButton(text = (“OK”, “click!”, “rolling over”, “disabled”),scale=.05,command=setText)

maps = loader.loadModel(‘button_maps.egg’)
b = DirectButton(geom = (maps.find(’/button up’),
maps.find(’
/button down’),
maps.find(’/button down’),
maps.find(’
/button dis’)))

run()

pls help

when posting code. please use the code tags. otherwise all indentation will be lost.

the egg-texture-cards command does not belong into your python code. thats why you get the syntax error.
it’s a seperate application provided by panda which you can use to create the egg-files.
you have to use it in a terminal/console/commandline provided by your operating system. if you are on windowsXP you can do “start->execute(or run?)-> cmd.exe”. under vista i dont know, for linux just open a regular terminal.
please have a look at your OS-manual/documentation.

note: you can (if you really want to) call regular commands in your system such as the egg-card thingy applicatoin from within python. but since those egg’s are not supposed to be created each time you launch your application i advice against doing it.

um
can you tell me exactly how what to write in cmd pls…
i’m kind of a beginner at this so sorry if i sound unprofessial and stuff :stuck_out_tongue:

You open the window command prompt by typing the command cmd into your run box. You can also create a new text document and type the word start into the body. Then you save the file as yourfilename.bat. Make sure that notepad (or whatever note program that you are using.) is set on all files when you are saving you file. This creates a simple program that opens the command window whenever you click it. This is nice.
You open the command window in macintosh by clicking on the terminal shortcut.
I dunno about linux.

You move into directories in the windows command prompt by typing “cd yourdirectoryname” (without quotes). You move out of directories using the “cd…” command. You move to a different hard drive in the command prompt by typing the name of the hard drive. You display the contents of the directory(also known as folder) by typing “dir”. You generally start a program by either typing the name of the program, or by typing the command “start yourprogramname”.

Reminder, this is for windows. I am less familiar with the mac terminal and am not familiar at all with the linux shell.

Hope that this quick tutorial helps.

on linux it works just the same as on mac: click the terminal shortcut in your menu. if you dont have any menus… you’r most likely inside a terminal already :wink:

once again. this is less an issue of panda but on how to use your operating system(so those chapters should be covered in the manual/help of your OS)

if you’r on windows you might find this link useful
http://www.amset.info/windows/dosprompt.asp

the comands cd and dir work the same under linux and windows (i guess this is true for macs,too)

to shut down your computer you just type “shutdown -s”

in windows again.


thanks for that help guys but i already knewn that…

i dont think i was clear so i apoligize… :blush:

all i want to know is what you type in cmd to execute this:

egg-texture-cards -o button_maps.egg -p 240,240 button up.jpeg button down.jpeg button dis.jpeg

and where/ how you would save the button_maps.egg file???

It would appear in the directory where you run that command.

If you already knew how to use the command prompt then why did you type that line in your python code? I’m not sure you understand what they were explaining if you think you already know that, because it sure looks like you don’t.

To recap all that’s been pointed out:

Don’t type that line in your Python code.

Instead, run the command prompt by typing “cmd” when you select Run from the Start menu.

Navigate in the command prompt by typing commands like "cd " to get to the directory with your images in it. thomas posted a link with more information about how to navigate in the command prompt.

Now type “egg-texture-cards -o button_maps.egg -p 240,240 button up.jpeg button down.jpeg button dis.jpeg” in the command prompt.

The egg texture card is now found in the same directory as the images.

“cd” works the same, but instead of “dir” you type “ls”

:question:

THx so much
life saver ^.^