Spread the love

This is a Sub-Control that really is only achievable with third party modules.
Both the button , and the text label are clickable.
I felt for a control it was useful to have both GUI Float + Bool along with DSP Bool and Volts outputs, which is easily done with a little planning.
Note: Purely out of interest this button structure is a good demonstration of the two-way communication between GUI modules- without this the option to have the text as clickable, and changing colour would not be possible.

DAM V Rectangle.

The DAM V Rectangle is connected so as to send a Float value of 1 when the button is clicked, with the mouse response set to the Step option this switches from 0 to 1 on the first click, then from 1 to 0 on the second click and so on.
The colour options I felt relevant to this project are connected to an IO module so the user can readily change them.

Mouse Response = Step
Gradient Point B (Y) and Alt Gradient Point B (Y) should be set to 50.
The colour options are:
Top ARGB = Off Top ARGB (Top gradient ARGB colour when button in the OFF state)
Bottom ARGB = Off Bottom ARGB (Bottom gradient ARGB colour when button in the OFF state)
Alt Top ARGB = On Top ARGB (Top gradient ARGB colour when button in the ON state)
Alt Bottom ARGB= On Top ARGB (Bottom gradient ARGB colour when button in the ON state)
Outline ARGB = Off Outline ARGB (Button outline ARGB colour when the button is in the OFF state)
Alt Outline ARGB = On Outline ARGB
(Button outline ARGB colour when the button is in the OFF state)

DAM Text Enter.

The Text Enter module displays the Text on the button which is also clickable.
Again some of the options are taken to an IO Module so that the options can be set as required by the user.

Text = The text label that appears on the button.
Font Size = The size of the label on the button. Entered as a float value, but goes up in steps of 1 pixel in direct proportion to this value.
On Text ARGB = The ARGB value for the text colour when the button is in the ON state.
Background colours. These should be preset to an ARGB value of 00000000 (you can just set the first two digits as 00) to give a transparent background for the text.
Module Settings:
Writable:
Un check this box so that when the button is clicked the text box does not change to white, and the text cannot be changed.
Font Options: Apart from Font ARGB and Font Size, set these as required for the font type, alignment and styles.

Logic switching.

We need to use a bit of Logic for making the Text Label behave in the same way as the button. Nothing too complex though.
ED Toggle Switch. This is used to toggle the Text Label state between on and off rather than it’s default momentary state. It’s connected between the mouse down output on the Text Enter module and the output of the Float To Bool converter. The output of the Float To Bool converter is also connected to the Choice plug of ED Switch > String module. The Switch module selects the ED Fixed_String module with it’s value of FF555555 (a dark grey, or alternatively a value of your own choice) when the Button/Text are in the OFF state, and the option set by the user at the On Text ARGB plug when the Button/Text are in the ON state.

Important Setting.

When you have finished the structure, go to the Panel view, and align the text label over the button where you want it positioned, and make sure you right click the text label and select Arrange > Move To Front. The Z view positioning of the text must be in front of the button.

The button in it’s On and Off states.