Thread: Push a button
View Single Post
  #1  
Old 07-20-2009, 01:20 AM
snoopy78 snoopy78 is offline
Member
 
Join Date: Jul 2009
Posts: 4
Push a button

Hi,

I want to push a button with my mouse and afterthat my object should rotate for a special amount.

This works, but I had to push the button again and again.

Code:
def onButton(obj,state):
  if obj == scene3.btnLeftRotate1:
    if state == viz.DOWN:
      object1.rotate(-1,0,0,'',viz.RELATIVE_LOCAL)

viz.callback(viz.BUTTON_EVENT,onButton)

I want to push the button one-time with my mouse and as long as I hold the button pressed, the object should move on and on.
Reply With Quote