Hi, here are some instructions:
– create your different buttons (uiImageButton) with 2 values 0 1 and 2 image frames
– give them a name including the position of the button (this is only needed if you want to act on the radio group by a lua program). Like Preset1 Preset2…Preset16
– Put a value in the Radio group property for all the buttons that are in the same radio group. For example 1
– clicking on one button will set it ON and the others OFF
To perform some action based on the selected button you need to build a lua program.
– create a lua method with type luaModulatorValueChange that will be triggered by all the buttons of the same radio group
– in your PanelLoaded method, add the declaration of all the modulators used in the radio group and put those variables in an array. This will make the scanning easier. So:
modPreset1 = panel:getModulatorByName("Preset1")
modPreset2 = panel:getModulatorByName("Preset2")
modPreset..
modPreset16 = panel:getModulatorByName("Preset16")
tPresets = {modPreset1, modPreset2, modPreset.., modPreset16}
– in your modulator change method you can now scan all Presets buttons to find the one which is ON. Use some code like this:
for i=1,#tPresets do
if tPresets[ i ]:getModulatorValue()==1 then do_something end
end
Hope it will help
-
This reply was modified 5 years, 4 months ago by goodweather.
-
This reply was modified 5 years, 4 months ago by goodweather. Reason: Correction
-
This reply was modified 5 years, 4 months ago by goodweather. Reason: Added warning
-
This reply was modified 5 years, 4 months ago by goodweather.