Trouble with Radio Button group in App Designer

6 次查看(过去 30 天)
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!

回答(1 个)

Cris LaPierre
Cris LaPierre 2021-9-28
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

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by