WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 06-27-2010, 11:34 AM
IGoudt IGoudt is offline
Member
 
Join Date: Sep 2009
Posts: 20
From my experience, you can register events only once.
For example:

Class A registers a viz.MOUSEDOWN_EVENT
Class B registers a viz.MOUSEDOWN_EVENT

Then if I recall correctly the last register will overwrite the first. What I did to resolve this, is to put all the registers in one of the main, or container, classes. Whenever an event is triggered there, the main class redirects the event to the appropiate classes or objects.

In your case, I guess your main class creates an instance of the MusicOnOff class (a button), and saves it under a variable. Change to:

Code:
class MusicOnOff:
       def __init__(self,musicObj):
             self.Obj = musicObj
             self.musicIcon = viz.addTexQuad()
             self.pictures = [viz.add(‘musicOff.png'), viz.add('musicOn.png')]
             self.musicIcon.texture(self.pictures[1])
             self.musicOn = True
             
             
       def click(self):
             
             self.musicOn = not self.musicOn
             self.musicIcon.texture(self.pictures[self.musicOn])
             if not self.musicOn:
                    
                    self.Obj.pause()				
             else:
                    self.Obj.play()
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Realistic Light and Shadows Using Vizard and 3DS Max jde Vizard 4 07-13-2012 11:58 AM
.3DS importing in Vizard and 3D Studio jde Vizard 1 08-28-2009 04:14 PM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 12:13 PM
Vizard tech tip: Text to Speech Jeff Vizard 1 01-15-2009 10:39 PM
Vizard and Augmented Reality realvision Vizard 4 04-04-2008 11:59 AM


All times are GMT -7. The time now is 04:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC