Add Buttons to a project to allow users to perform functions like displaying or hiding objects, playing animations, executing programs, or opening a website.
Button samples
1. | Create a new, or open an existing project. |
2. | Insert a terrain model, as described in Terrain Models, if one has yet to be inserted into the project. |
3. | From the Insert menu, click Button. |
4. | In the Insert Button dialog box, configure the button settings and click Insert. |
1. | Insert a button, or select a Button object in the Objects window. |
2. | In the Button dialog box, or in the Object Properties window, make the following settings on the General tab; |
• | Name – Specify the name of the button object. This is the object name that appears in the Objects window. |
• | Button Type – Select the type of button. |
o | Rectangle – The shape of the button is rectangular. |
o | Ellipse – The shape of the button is elliptical. |
o | Empty – The button displays no shape, but the text is visible. |
o | Image – The button uses a background image. You can |
• | Background Images – Specify images for the Released and Pressed states of the button. This is only available when the Button Type is set to Image. |
• | Color & Transparency – Select a color for the button appearance and set the transparency ranging from 0 - 100, where 100 is completely transparent. Default = 0. |
• | Button Geometry – Choose the placement of the button in the main viewport. Either drag and drop the gray box in the preview window or enter new X and Y position values. You can also adjust the width and height values for the button. |
Adjusted width values for a rectangular and elliptical button.
3. | Click the Contents tab, and make the following settings; |
• | Button Text – Enter the text that appears in the button in the main viewport. |
• | Font – Select a font for the button text. |
• | Font Size – Specify the font size. |
• | Font Color – Choose a color for the button text. |
• | Icon – Click the Browse button to select an icon image that is displayed next to the button text. |
o | Left – Places the button icon to the left of the button text. |
o | Right – Places the button icon to the right of the button text. |
o | Top – Places the button icon above the button text. |
o | Bottom – Places the button icon below the button text. |
o | Remove – Click the X button to remove the button icon. |
• | Icon Size – Set the width and height of the icon. |
• | Transparency – Set the transparency ranging from 0 - 100, where 100 is completely transparent. Default = 0. |
• | Alignment – Choose the placement of the button in the viewport. Either drag and drop the gray box in the preview window or enter new X and Y |
Samples of different content (icon or text), alignment, font and font size.
4. | Click the Command tab to edit the button functionality. |
A command can be assigned to a button by using a simple script language. This script language contains multiple commands, which are described below.
• | Toggle Button – Enable if you want the button to perform a one command when pressed and another command released. |
• | Button Press Command – Enter the command that the button performs when pressed. |
• | Button Release Command – Enter the command that the button performs when released. Only available if Toggle Button is enabled. |
• | Check – Checks and notifies you if the command string you've entered is valid. |
Park shown
|
Park hidden
|
Example of a SHOW/HIDE button that controls the display of vector data, like a park boundary.
Syntax:
<command>
|
::=
|
<action> <object> [USING <parameter>+]
|
<action>
|
::=
|
DO | SHOW | HIDE | PLAY | GOTO | LOOKAT | USE
|
<object>
|
::=
|
<sceneobject> | <animation> | <token> | <applicationcommand>
|
<sceneobject>
|
::=
|
object in the project tree
|
<animation>
|
::=
|
animation object
|
<token>
|
::=
|
DEFAULTPOSITION | ANIMATION | SPHERENAV | CONENAV | GAMENAV | UFONAV
|
<applicationcommand>
|
::=
|
EXIT | SNAPSHOT |
EXEC USING CMD=<value> [<parameter>+]
|
<parameter>
|
::=
|
<name> = <value>
|
<name>
|
::=
|
DIR | PARAMS
|
<value>
|
::=
|
string literal
|
Semantic:
•
|
DO + <applicationcommand>
|
•
|
SHOW + <sceneobject that has visual representation>
|
•
|
HIDE + <sceneobject that has visual representation>
|
•
|
PLAY + <animation> | ANIMATION | <sceneobject of type videolayer>
|
•
|
GOTO + DEFAULTPOSITION | <sceneobject of type bookmark> | <sceneobject that has visual representation>
|
•
|
LOOKAT + <sceneobject that has visual representation>
|
Examples:
•
|
DO EXEC USING CMD=notebpad.exe,DIR=c:\windows
|
•
|
DO EXEC USING CMD=www.autodesk.com
|
|