Player rooms lists???

Heya guys, on my menu, I want to make it to where It will start showing an entire list of current games/avaliable rooms at that time. Currently , yes I have a code where it shows an available room and how many players, etc. and that’s fine, but when I ran several instances of the game and made different rooms, they aLL showed up at the same spot! How can I make it to where it will show one room, then another available room right under it, and so on? So heres the code in which it shows the available room . I also send the entire script in case its needed. Thanks all

   //this is the button where you can join current rooms!       
{
                GUI.Label(new Rect(Screen.width*0.6f , Screen.height*.05f, Screen.width*0.2f , Screen.height/7.9f), roomInfo.name + " " + roomInfo.playerCount + "/" + roomInfo.maxPlayers);
                if(GUI.Button(new Rect(Screen.width*0.8f , Screen.height*.05f, Screen.width*0.2f , Screen.height/7.9f), "Join"))
                {
                    PhotonNetwork.JoinRoom(roomInfo.name);
                }
            }

2184793–144836–WorkerMenu.cs (8.81 KB)

The Rect you use for positioning is the same for all entries.
If you want an easy solution, use GUILayout.Button(), etc…

Yes, actually it came from a GUI.Layout Button but I don’t like that because it doesn’t autosize :confused: I tried it on several devices but some it appears big and some really tiny. The code I have above it auto resized. Is there a way GUI.Layout can be autoresized ?

GuiLayout is self sizing to fit content or it’s parent “block” or “area”. If you have a very long string, the buttons that you create below that string will be very wide. There are GUIOptions to not stretch a button and there is a way to define the absolute width, too. Search the Scripting API and Manual.

If you want cross-device UI, skip the “old” UI and use the new one. It takes a moment to get to know it but it’s really good and it even has a component to scale itself!

ok, so worked on the gui and it works, somewhat. when a player creates a room, it shows up. When another player creates room, it shows under it! (awesome!). Now when a third player creates a room, it stretches , or looks really weird. Ill post the updated code .

            Rect content = new Rect(0 , 0, Screen.width , Screen.height);
            GUI.Box(content,"Multiplayer Lobby - Join Room");
            GUILayout.BeginArea(content);

            foreach (RoomInfo roomInfo in PhotonNetwork.GetRoomList())
            {
                GUILayout.BeginVertical();
                GUILayout.Label( roomInfo.name + " " + roomInfo.playerCount + "/" + roomInfo.maxPlayers);
                if(GUILayout.Button("Join", GUILayout.Width(150)))
                {
                    PhotonNetwork.JoinRoom(roomInfo.name);
                }
            }
            GUILayout.EndArea();

I’m sorry, I can’t help with UI coding. At least not in detail.
You should elaborate what “it streches” means in this case. The label? That doesn’t have a width setting. This might stretch.