Trouble with Radio Button group in App Designer

1 view (last 30 days)
Dear all,
Currently I am designing a game. For the main menu I am using the app designer. In the main menu there is a Radio Button Group in which you can either select 'Single player' or 'Multiplayer'. Now I am trying to program that when you click on the Startbutton 'Start' a specific mlx. file will run, depending on what option was selected. I just started with Matlab and I coudn't find it on youtube or on Mathworks.
Thank you in advance!

Answers (1)

Cris LaPierre
Cris LaPierre on 28 Sep 2021
The callback for your start button needs to check the value of your radio button and use an if statement to load one mlx file if single player is selected, and a separate one is multiplayer is selected.
One way to do that is to make selectedButton a property of the app. Then you will always be able to query the current radio button selection from any callback. See this page: https://www.mathworks.com/help/matlab/creating_guis/share-data-across-callbacks-in-app-designer.html

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!