<viz>.director

This commands provides a facility for executing a function that halts program flow without actually stopping the real-time graphics rendering

 

<viz>.director(
    function    # function pointer
    args    

)

 

function

Specifies the function to be executed.


args

Optional arguments to pass on to the director function


Remarks

This command executes the specified function in a separate thread, thereby allowing you to use control flow state would otherwise be incompatible with real-time, event driven program as is Vizard's standard. Examples are while loop, user prompting, and time delays.

Return Value

None

Example

def example1():
    #Display object for 1 frame
    object.visible(1)
    viz.waitframe()
    object.visible(0)

def example2(t):
    #Display object for specified amount of time
    object.visible(1)
    viz.waittime(t)
    object.visible(0)

.
.
.

viz.director(example1)
viz.director(example2,0.5)

See also

<viz>.waitkeypress
<viz>.waitframe
<viz>.waittime