Page 1239 - Kitab3DsMax
P. 1239
Chapter 49: Automating with MAXScript
To add one of these elements to the form, click the element button on the toolbar and drag on the form.
The element appears and is selected. The selected element is easy to identify by the black handles that
surround it. Dragging on these handles resizes the element, and clicking and dragging on the center of the
element repositions it within the rollout space.
The Value and Events panels are automatically updated to show the values and events for the selected element.
Values such as width and x-pos are automatically updated if you drag an element or drag its handles to resize it.
Aligning and spacing elements
Although only one element at a time can be surrounded by black handles, you can actually drag an outline
in the rollout space to select multiple elements at once. With several elements selected, you can align them
all to the left (Ctlr+left arrow), horizontally centered (Shift+F9), right (Ctrl+right arrow), top (Ctrl+up
arrow), vertically centered (F9), or bottom (Ctrl+down arrow).
Multiple elements can also be spaced across (Alt+right arrow) or down (Alt+up arrow). To make several ele-
ments the same width, height, or both, use the Layout ➪ Make Same Size menu command. The Center in
Dialog menu aligns elements to the center of the dialog box either vertically (Ctrl+F9) or horizontally
(Ctrl+Shift+F9). The Flip command reverses the position of the selected elements.
Figure 49.19 shows a form with several aligned elements added to it.
FIGURE 49.19
You can add control elements to the form in the Visual MAXScript window.
Tutorial: Building a custom rollout with
the Visual MAXScript Editor
Now you need some practice using this powerful tool. In this example, you use the Visual MAXScript win-
dow to lay out a rollout and code the script to make it work.
1191