Hi everyone,
I have serious problems to show at the user some messages that occurs during the game.
I’m making a “Galaga” style game and I want , during the game, that there are some conversations between the pilot (or the hero) and the HQ.
In simple, I want a message system like any RPG game, where the message popup and you press something to go on.
I have tried to use label and box but the result are unsatisfy.
PS. I’m scripting in C#, but Javascript script are welcome too.
GUI Box and Layers are perfect for that, what is it that unsatisfy you ?
I’m not an expert, but this is how I do : let’s say you want to show a pop-up if a condition is true. You declare this condition as a boolean. In your OnGUI() function, you test if this boolean is true. If it is, you use GUI.Box to show the message.
Take a look at the GUI scripting guide in the docs.
You right. I haven’t thought to merge a box and a label together. It must be the tiredness.
Another little question: How can I make the font in Bold style, for example? I’m using the default Font or Unity.
You just have to declare a GUIStyle variable, and pass it as a third argument in the concerned functions (label, box if there’s a title).
In the Inspector, you’ll have a lot of properties, bold style is among them.
You should really look at that : Unity - Manual: Immediate Mode GUI (IMGUI) . Especially take a look on GUI Skin, I don’t use it cause there’s not a lot of GUI in my games but I think it would be perfect for you.