- Home /
Scrolling Text (For Updates)
I've been trying to use a few methods to make text scroll from right to left and repeat when it hits the edge of the screen but I can't seem to figure it out. I'd like to be able to post news/updates and have it scroll across the top of the screen. Are there any tuts on this?
Not sure I can help but can you clarify how you're trying this, is it the new GUI the old OnGUI 2D/3D game?
Like I said I might not be able to help but it'll help others help you the more we know.
Within reason, don't write a novel about it :¬)
Answer by Ericool · Jan 10, 2015 at 01:52 AM
you can either choose the gui or a gameobject as guitexture. Then create a script attach it to the guitexture gameobject on scene or if you use the gui attach it to an empty gameobject.
Then your player script or whatever need this script reference. In the text script make a public method like public bool popupdates(string msg){
Guitext.text = msg; This.gameobject.transform.position = new Vector(firstPosition); Activate =true; // enabled = true; or something to show it } Bool Activate = false; Float xpos_factor = 2.0f; Void Update(){ If(Activate){ If (this.gameobject.transform.position.x < maxPos.x){ Gameobject.transform.translate(xpos_factor * Time.deltatime,0,0); }else{ //done //Do something like a delay If ( ! Delay() ){ // delay done Activate = false; // enabled = false; or hide it } } } Return true; // success }
Bool Delay(){ // to do }
Sorry for every mistake i am using an iphone... Good luck
Your answer

Follow this Question
Related Questions
How to get offset of a ScrollRect? 0 Answers
Scroll lagging too much 0 Answers
Pass through control on UI elements? 0 Answers
Scrollable Text of Arbitrary Length 0 Answers