Button and Credits Dialog Box

Pardon the simple question…

How do I put a small button in the lower right hand corner of the screen that then displays a small credits dialog box? Can someone point me in the right direction? That box would just have a bitmap with credits and a dismiss button.

Thanks.

I use the GUI.Button class for that. :smile: So the button can then activate a GUI.DrawTexture branch in your OnGUI function. In the branch where you’re displaying the texture then watch iPhoneInput.touchCount>0 to see if the screen is tapped. If so, exit the branch.

Thanks!

Is this what you meant? It hangs. Can you see what I’m doing wrong?

function OnGUI () {
	if (GUI.Button (Rect (Screen.width - 52,Screen.height - 32, 50, 30), infoIcon)) {
		GUI.DrawTexture(Rect (0, 0, Screen.width, Screen.height), helpScreen);
		
		// wait until a touch is received
		while (iPhoneInput.touchCount == 0);
	}
}

I usually use a var to track what menu is being displayed

private var menu: String = "main";

function OnGUI () {
   if (menu == "main") {
      if (GUI.Button (Rect (Screen.width - 52,Screen.height - 32, 50, 30), infoIcon)) {
         menu = "credits";
      }
   } else if (menu == "credits") {
      if ( GUI.Button(Rect (0, 0, Screen.width, Screen.height), helpScreen, "label") {
         menu = "main";
      }
   }
}

Yea, I didn’t elaborate quite enough, ezone is correct in that you must use some flag variable to determine which menu to display. Your while loop is causing the hang since it will never exit, thus preventing any future updates to touchCount.

Works great. Thanks!