Image:
 Author: Xray Group: Default Filesize: 265.1 kB Date added: 2023-07-21 Rating: 5 Downloads: 969 Views: 347 Comments: 6 Ratings: 1 Times favored: 0 Made with: Algodoo v2.1.0 Tags:
|
Here is a single button when user clicks it, the torque value will switch between 2,000 and 50,000. The global variable called scene.my.torque holds the current torque value.
How to include this button in your scene: First download this scene and open it in Algodoo. You will see one button. Select the entire button including the label above it. When selected, use the Move tool to move the button and label into your "Components" folder. Once in your Components folder you can close this scene and then open your wood chipper scene. When open, point your cursor on the "Components" folder and grab the button with text label and slide it to any place on the background. Don't put it on your machine yet because it will be hidden behind the machine. You must select both the button and label. When selected, hold down the Shift key and roll your mouse wheel back toward you. That should move the button to the front layer. Now you can move it and place it on your machine anywhere you like. Then go into the motor script menu and you should see the variable "motorTorque". In the text box you should see a number like 2000 or 50000. You can delete that number and replace it with the following script:
{ scene.my.torque }
Make sure to include both curly brackets. Now close the script menu and save your scene. Now test it by running the scene and clicking the button. It should switch between 2000 and 50000 torque value. If desired, you can modify anything like the label text and the torque values if you so desire. |