WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-27-2010, 12:47 AM
renama renama is offline
Member
 
Join Date: Jun 2010
Posts: 15
Here is the code of the class (same with the previous attachement)
Code:
class MusicOnOff:
       def __init__(self,musicObj):
             self. Obj = musicObj
             self.musicIcon = viz.addTexQuad()
             self.musicIcon.texture(viz.add((‘musicOff.png')))
             self.musicOn = True
             viz.callback( viz.MOUSEDOWN_EVENT, self.onMouseDown )
       def onMouseDown(self, button):
             if button == viz.MOUSEBUTTON_LEFT:
                   object = viz.pick()
                   if object.valid() == False: return
                   if object == self.musicIcon:
                          if self.musicOn == True:
                                 self.musicOn = False
                                 self.musicIcon.texture(viz.add((‘musicOn.png')))
                                 self.Obj.pause()				
                          else:
                                 self.musicOn = True
                                 self.musicIcon.texture(viz.add((‘musicOff.png')))
                                 self.Obj.play()

Last edited by renama; 06-27-2010 at 12:52 AM.
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 10:58 AM
.3DS importing in Vizard and 3D Studio jde Vizard 1 08-28-2009 03:14 PM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM
Vizard tech tip: Text to Speech Jeff Vizard 1 01-15-2009 09:39 PM
Vizard and Augmented Reality realvision Vizard 4 04-04-2008 10:59 AM


All times are GMT -7. The time now is 08:20 AM.


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