Log in

View Full Version : Delay without viz.waittime?


Johannes
03-15-2005, 09:40 AM
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

farshizzo
03-15-2005, 11:11 AM
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:def onactionend(object,action,pool):
if object == screenWall and action == viz.MOVE:
putGraphOnScreenWall()

viz.callback(viz.ACTION_END_EVENT,onactionend)

Johannes
03-16-2005, 08:59 AM
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: