Different streched size GUI selection grid

I’m making text based game and my options in game aren’t fit well. Someones should be bigger for see text and someones should be smaller.I can’t do with selection grid .Any opinion?

May i must use toggle but toggle in GUI not grouped so it will not change other toggle. Reason of cancer…

toggle isn’t possible when number of options are not stable . It cause creating new bool object on GUI over and over ( -.- )

All your problems can be solved, I am sure.
To start with the first question: you can assign a toggle group to your toggles. All toggles of the same toggle group behave like radio buttons then (I think that is what you are looking for). You just have to add one Toggle Group to a game object (e.g. the parent of the toggles) and assign it to the toggle group object fields in all toggles.

your second problem: not sure exactly what the problem is. It is possible to create your toggles via code (UnityEngine.Object.Instantiate(prefab, parent, false)).

I must use GUILayout because get strings from XML that unclear how many and changing therefore I cant use UI editor for show strings. And there isn’t toggle group in guilayout but selectionGrid .With selectionGrid ,size of buttons are same but some of my strings are long for button .It cause switch text clipping clip to overflow for show text
2987575--222348--hgf.PNG

Actually :smile: I just looked for word wrap and opened it but size of button didnt changed so i use custom toggle group for show strings
2987575--222349--gfv.PNG

looks like your using the legacy UI of unity.
This forum is for the new UI system.

BTW: For games there is no reason to use the old system at all… it is ugly and bad in performance. you should seriously consider to switch to the new UI system.

uh I was think IMGUI is new system that use GUILayout.Label and old system like GUI.Label. So scripting is old system?

I switched to new system . this is still not fixed . I know opening min size on “vertical fit” manually . But it must be automatically because long of my text are not same and min size do unnecessary space in between toggles