- Home /
Question by
superluigi · Apr 29, 2015 at 03:43 AM ·
richtextbox
How to apply custom text to Photon Code?
#pragma strict
var style : GUIStyle;
function Start ()
{
PhotonNetwork.ConnectUsingSettings("1.0");
}
function OnGUI()
{
GUI.Label(Rect(10,10,300,300), PhotonNetwork.connectionStateDetailed.ToString());
var i : int = 0;
for each(var cuarto : RoomInfo in PhotonNetwork.GetRoomList())
{
Debug.Log("hi");
GUI.Box( new Rect( 170, 120 + (i * 30), 300, 25 ), <b> cuarto.name + " " + cuarto.playerCount + "/" + cuarto.maxPlayers </b>, style );
..........
the last line is the one giving me an error: (Unexpected token: <). I realize I can do this in the inspector, but I want to learn why the code isn't working.
Comment
I think your styling code needs to be under "".
So:
GUI.Box( new Rect( 170, 120 + (i * 30), 300, 25 ), "<b>" + cuarto.name + " " + cuarto.playerCount + "/" + cuarto.maxPlayers + "</b>", style );
Your answer
![](https://koobas.hobune.stream/wayback/20220613194318im_/https://answers.unity.com/themes/thub/images/avi.jpg)