View Single Post
  #2  
Old 07-13-2009, 09:52 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Your createButton function should return the button object and you should save the object in a global variable with the name you want. For example:
Code:
def createButton(self, position, pictureOff, pictureOn, name, szene):
	self.Position = position
	self.PictureOff = pictureOff
	self.PictureOn = pictureOn
	self.Name = name
	self.Szene = szene
		
	name = viz.add(viz.BUTTON, scene=szene)
	name.translate(position[0],position[1])
	name.uppicture(pictureOff)
	name.downpicture(pictureOn)
	name.setScale(12,3.6)
	return name

button1 = createButton([0.25,0.8],'button01Off.jpg', 'button01On.jpg', 'button1', 2)
Reply With Quote