![]() |
#1
|
|||
|
|||
Delay without viz.waittime?
Hi,
how do I put a delay inside my skript? without viz.waittime which stalls the whole scene. I want a projector screen to move down bevor graphs get put on it. If I do: screenWall.goto(0,-2.2,0, .8) putGraphOnScreenWall() the graphs are on the ScreenWall before it is down... Thank you, Johannes |
#2
|
|||
|
|||
You will need to use a callback for this. The following callback is called every time a built-in animation finishes. Check when the screen has finished moving then call your function:
Code:
def onactionend(object,action,pool): if object == screenWall and action == viz.MOVE: putGraphOnScreenWall() viz.callback(viz.ACTION_END_EVENT,onactionend) |
#3
|
|||
|
|||
Thank you.
It works 90 % fine. When the user klicks on the graphOnWall Checkbox again, before the projection-surface is completely up, the graphs get put in the air. I guess that is because while the projection-Surface is moved up and the user clicks the checkbox the movement is stopped => ACTION_END_EVENT is triggered, checkbox is ON and so the graphs get put in the air. To solve this I would need to check, if the ACTION_END_EVENT occured after the surface moved down vs. up. Sorry, solved it while writing this: if checkboxWall.get()==1 and screenWall.get(viz.POSITION)[1]==0: |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|