- Home /
UI button OnClick() how to show a text / Message on a popup.
Hi guys! i want to show a message when i make click on a button, i think the best way would be a popup.
Any idea of the script? I'm sure is quite simple!
Thanks!
Im trying to use this script
using UnityEngine;
using System.Collections;
public class popup : MonoBehaviour {
public var showPopup = true;
function OnGUI() {
if (showPopup) {
popupButton = GUI.Button(Rect(670,340,200,40), "Text to show");
}
}
Comment
Answer by YoungDeveloper · Apr 16, 2015 at 12:40 PM
function Update() {
if(Input.GetMouseButtonDown(0)){
showPopup = !showPopup;
}
}
I strongly suggest working with new UI.
Your answer
Follow this Question
Related Questions
Button on Panel is not responding 1 Answer
Problem with onClick.AddListener 1 Answer
Button position scaling weird 1 Answer