![]() |
#1
|
|||
|
|||
Vizact onupdate events that wont be disabled
Hey
So my problem is that once i have registered 2 separate onupdate events i cant disable them or remove them. this is where how i create them: self.update = vizact.onupdate(viz.PRIORITY_PHYSICS-1, self.UpdateJoystick,viz.getFrameElapsed()) self.postupdate = vizact.onupdate(viz.PRIORITY_PHYSICS+1, self.PostPhysics) then for disabling and re-enabling them. def Pause(self): #vizact.removeEvent( self.update ) #vizact.removeEvent( self.postupdate ) self.update.setEnabled(viz.OFF) self.postupdate.setEnabled(viz.OFF) pass def Resume(self): #self.update = vizact.onupdate(viz.PRIORITY_PHYSICS-1, self.UpdateJoystick,viz.getFrameElapsed()) #self.postupdate = vizact.onupdate(viz.PRIORITY_PHYSICS+1, self.PostPhysics) self.update.setEnabled(viz.ON) self.postupdate.setEnabled(viz.ON) pass i have tried to remove them, then re adding them, i have tried to use vizact.removeevent, but that didn't work either, but in the resume function when i recreated them it would double them up, as they werent being removed ![]() the pause and resume functions are called by a joypad button press thanks in for any help you can provide |
#2
|
|||
|
|||
You can use <EventFunction>.setEnabled to enable/disable the callback:
Code:
event_handle = vizact.onkeydown(' ',myFunction) event_handle.setEnabled(viz.OFF) |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with server Events | vOliver | Vizard | 2 | 09-15-2010 02:21 PM |
how to remove velocity when mouse is disabled? | jvacare1 | Vizard | 2 | 02-18-2010 10:25 AM |