- Home /
 
 
               Question by 
               BigDakaFa7 · Aug 15, 2013 at 07:31 PM · 
                guichat  
              
 
              BeginScrollView question on auto increasing
Ok so i had a really quick question. I have some code that is a chat window and it logs messages and works fine but i was wondering if i can make the chat window auto increment as a message is received here is my code
void OnGUI() {
         GUIStyle boxStyle = "box";
         boxStyle.wordWrap = true;      
 
         stringToEdit = GUI.TextField(new Rect(Screen.width /50f,Screen.height / 1.05f, 300,20),stringToEdit,25);
         Event e = Event.current;
         if(e.keyCode == KeyCode.Return && !chat){
             chat=true;
         }
       scrollView = GUI.BeginScrollView(new Rect(Image.pixelInset.x ,Screen.height - (Image.pixelInset.height / 1.5f) - Image.pixelInset.y * 4f, Image.pixelInset.width ,Image.pixelInset.height / 1.8f), scrollView, new Rect(0,0,100,500)/*, new GUIStyle(), GUI.skin.verticalSlider*/);
       GUI.TextArea(new Rect(0,0,999999,999999),msglist);
         GUI.EndScrollView();
         
 
              
               Comment
              
 
               
              Answer by jacobschellenberg · Aug 15, 2013 at 07:43 PM
I would recommend ditching Unity's GUI framework and go with: NGUI. It is a very powerful GUI framework with everything you need. There is even a chat box tutorial. Try it out with the free version.
Your answer
 
             Follow this Question
Related Questions
Ingame Chat script 1 Answer
How to create a gui button inside an if statement? 1 Answer
GUIText Help 1 Answer
How To Make GUI Buttons Load/Quit 1 Answer
How to get a value from an array within another script. 1 Answer