UI Types for Applets |
Top Previous Next |
JavaScript, Lua Apps and Widgets use identical Input and Output types. Here are the selections. Inputs
Draggable - any points in the Mechanical Expressions model constrained by variable Coordinates or a variable parameter for the Point Proportional constraint can be set as Draggable points in the JavaScript, Lua app or Widget. The point's constraint variables, however, cannot be functions or negative; only positive variables are allowed for defining draggable points. I.e., the value of the variable may very well be negative, but using -t as the point proportional parameter or (x, 3*x) as a point's coordinates prevents the point from being draggable. Slider - takes it's range from the values specified in the MX Animation in the Variables panel. Text Box - lets you enter any numeric value for the variable. For a function, you have the choice of a single line Text Box or a Multiline Text Box. Remember to use the JavaScript return statement in multi-line statements in JavaScript Apps or Widgets. ![]()
Advance Button - displays the variable Label on a button and increments the variable when clicked. Uses the range and direction from the MX animation settings. If you used decimal values in MX, the values a reduced to integers. Media Controls - works like the Advance Button but gives you some additional options. For values within the specified range, you can:
Timer - this is great for making Clock Applets and smooth animations. Here are the Timer Styles:
The hour, minutes and seconds are taken from your computer's clock. Random - gives the specified variable a single random value within the range set in the MX Variables tool panel. To change the variable's value to another random number click the Reload button Any measurements which are present in the Mechanical Expressions model may be chosen as outputs for the JavaScript, Lua Apps or Widgets. Check the Show in Export checkbox and modify the Label if needed. ![]() UI Type - Plain Text or Show / Hide Button which is a toggle.
|