Next Previous Contents

Making variables

Variables give the program using a GLASS object control over its shape. Variables are easy to make.

Select the object item in the object tree and use the menu Object->Add Variable. Edit the variable in the usual method giving the variable dialog:

This variable can be used to make the cone float to a variable height, so I've called it "cone height", and set a maximum of 5.0, and a minimum of 0.0.

Going back to the component made in the last example, change the transform to "Translate Y". Beside the spin button there is a button with the label "V". Pressing this swaps the spin button for a combo box with the list of available variables. Select "cone height". You will notice that the views now show the cone sitting back where it started. If you go to the variable dialog, and check "Auto-update", moving the slider bar (to change the current value), will make the cone move up and down. Priceless.

That's about it with variables!


Next Previous Contents
Robert Cleaver Ancell
Last modified: Thu Aug 16 23:13:38 NZST 2001