Okay I can now make it work with one button- I am understanding a little bit about this now and I can make my dialog scroll down through several layers of text based on one button.
So I must now change the behavior of my functions based on which button gets pushed. Button numbers can vary from one to five.
So how does the buttonValueList work and how do I pass that button over to the command line? This is not in the example provided in the manual:
here is the example from the manual:
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *
from direct.task import Task
from direct.actor import Actor
from direct.interval.IntervalGlobal import *
from pandac.PandaModules import *
#add some text
bk_text = "DirectDialog- YesNoDialog Demo"
textObject = OnscreenText(text = bk_text, pos = (0.85,0.85),
scale = 0.07,fg=(1,0.5,0.5,1),align=TextNode.ACenter,mayChange=1)
#add some text
output = ""
textObject = OnscreenText(text = output, 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 itemSel(arg):
if(arg):
output = "Button Selected is: Yes"
else:
output = "Button Selected is: No"
textObject.setText(output)
#create a frame
dialog = YesNoDialog(dialogName="YesNoCancelDialog", text="Please choose:", command=itemSel)
base.camera.setPos(0,-20,0)
#run the tutorial
run()
I do not see any of the directDialog arguments on here… such as buttonValueList, buttonTextList etc. . .
I am sorry for being so dense but shouldn’t an example of directDialog use the arguments listed rather than some other method I can’t figure out? I am assuming that this example is pulling in predefined functions from another file somewhere.
This appears to an if or that function, that doesn’t apply to more than two buttons.
So how do I setup my buttonValueList and call my command based on that list?
Thank you,
JB Skaggs