Reference: GUIs

Prompts

In addition to GUI elements, you can also elicit user input with dialogue-box style prompts. Vizard has a standard start-up promt that you can use as well as several other styles of prompts.

Start prompt

Vizard offers a built-in start prompt that allows the user to control the modes in which a program launches. This prompt (shown below) provides a number of checkboxes and a text box although only fullscreen rendering ('Fullscreen') and stereo rendering ('Stereo') are automatically invoked if you click those boxes. The other boxes are up to you to use.

 

 

To obtain information the user selects use viz.get(<what>) in your script where <what> is one of the following flags:

 

Flag

What is returned

HMD

0 or 1: HMD/fullscreen mode selected

STEREO

0 or 1: stereo mode selected

TRACKER

0 or 1: tracker selected

OPTION1

0 or 1: Option 1 selected

OPTION2

0 or 1: Option 2 selected

INITMESG

string: what the user entered in edit field

 

Example:

viz.go(viz.PROMPT)
goTracker = viz.get(viz.TRACKER)

if goTracker:
  print "user selected tracking"
  # add sensor device as appropriate

Ask the user a yes/no question

Use viz.ask() to create the dialogue box below. Your answer will be a 1 or a 0.

 

 

Example:

answer = viz.ask('Are you ready?')

Prompt the user to choose from a list of options.

Use viz.choose() to create a dialogue box with a pop-down menu of choices. The user's answer will be the order of their response within the array of options.

 

 

Example:

answer = viz.choose('Select...', ['one', 'two', 'three'])

Prompt for a string

Use viz.input() to get a dialogue box which elicits a string:

 

 

Example:

answer = viz.input('Enter your name:')

Provide a message

Display a message box to the user:

 

 

Example:

viz.message('There was no data recorded!')

See also

In this section:

User interface basics

GUI elements

Getting data from GUI elements

Organizing GUIs with vizinfo

Making pop-downs with vizmenu

GUI appearance

Prompts

Displaying HTML

GUI command table

Other sections:

Event Basics

Action basics

Text node basics

Example scripts:

vizInfo

vizMenu

Prompt