-
Notifications
You must be signed in to change notification settings - Fork 89
Making a button
There are at least three ways to make a button. (are there more)
- getting a button from the factory and giving it a method to call (details below)
- use
Create buttonin the middle-button/opt-button (yellow) menu. - use the core sampler to 'Yank it out' the Send button from the the middle-click/opt-click menu
- open the gasTank Morph
- Drag a button from the factory window on top of the has tank morph.
- Middle-click/opt-click the button and click 'set target'. This sets the target to the gas tank.
- Drag the button off the tank.
- Open an outliner for the button (right-click/cmd-click, click
Outliner of Morph...). - Click the
Eto get an evaluator. - type
script: 'target addAnAtom' - Click
Do it
A special menu item to create buttons. Who knew. I've made a quick youtube video: Adding a button
This way lets you use the Send button that is created when you middle-click/opt-click the method in the outliner.
- middle-click/opt-click the method
addAnAtomin the gasTank outliner - left-click(click!) the beveled bar at the top of the menu to 'pin' it.
- right-click/cmd-click the menu, then click
Core Sampler... - grab the core sampler and move the cross-hairs over the
Sendbutton - middle-click/opt-click
ui2Buttonthen clickYank it outto grab theSendbutton - place the
Sendbutton on the self workspace - click the
Sendbutton to add an atom to the gasTank Morph.
I've not yet fully worked out how to change label on a button. Add a wiki page if you can work it out.
Thanks to ardeujho for explaining how to make a factory button call a method. Thanks to Jecel Assumpcao Jr. for pointing me to the video for the core sampler technique. Thanks to Randall B. Smith and the other designers and builders of Self for making the video.
On Wed, Mar 5, 2014 at 9:50 PM, ardeujho wrote:
The basic steps for making a button are:
- Drag a button from the factory window on top of the has tank morph.
- Middle click the button and click 'set target'. This sets the target to the gas tank.
- Drag the button off the tank.
- Open an outliner for the button (right click, open outliner). Click the 'E' to get an evaluator. Run: 'script: 'target addAnAtom'
Now when you press the button it will call 'addAnAtom' on the target, that being the gas tank.