- Home /
GUI Text manipulation - flexible enough for my project?
So, I'm hoping to develop a "professional" version of a prototype text adventure I've been writing so far in Javascript with jQuery (ignore the tile engine stuff for now):
https://dl.dropboxusercontent.com/u/7885274/TestArea/InterLithOLD/InterLithOLD.html
Essentially, I want to use Unity (in its 2D mode) to create a fancy, modern interface, maybe add some bells and whistles, and package the whole thing into something I can maybe (eventually) sell.
The question is: text manipulation is the crux of the whole thing. Running from a browser, I can add text to on-screen elements, combine things, insert things... do whatever I need to do.
Example:
intercomAnswr3: function(){
$('#NARRATIVE').append('<p class="selected">:: ...</p><p>"Er, ' + glb.pVars.playerName + '? Hello?"</p><p>There is a rather awkward silence.</p><p>"Look, whoever answered the damn intercom; tell my XO to get their arse up to the control room. We\'re almost at the refinery."</p><div class="selections" id="selectONE"><b>1</b>:: Continue</div>'); contentBox.scrollBOTTOM();
}
I've been looking at the basic tutorials for GUI scripting in Unity, but before I dedicate the rest of my week to learning this stuff and leaping headfirst into Unity, I thought I'd make sure it's actually possible (without reinventing the wheel; I loved the shortcuts jquery offered me).
Can you append text and insert variables like this? Can you scroll text?
To put it simply: Is the prospect of porting this work to Unity possible with regards to text manipulation? I understand this is a bit of a vague question, but ironically calls for a simple yes/no answer >.<
Thanks.
Answer by Owen-Reynolds · Jun 29, 2014 at 10:18 PM
Unity doesn't support much in the way of fancy text. You can program just about anything, but very little built-ins. Changing the color/font of a single word is a huge pain. Moving text is fine, like up/down scrolling. But Marquee-style scrolling, within a limited area, is a huge, huge pain.
Of course, you can use regular C# functions to build your strings. But I suspect it doesn't support the nice Perl-style substitutions you're used to (and Unity javascript, isn't, I'm told.) You can easily fade out text. Oddly, you can make "Star Wars credits" pretty easily, by tilting the camera on 3DText.
Its sort of a "use Unity for 3D features, imports anything, physics engine, easy iOS/Android/web builds. Tolerate the GUI support."
Answer by sschaem · Jun 30, 2014 at 06:00 PM
One thing you will also find with Unity is that there is a lot a 3rd party extensions https://www.assetstore.unity3d.com/en/#!/category/141/page/1/sortby/popularity
If Unity doesn't do what you need, you might be able to find it offered via an extension.
Ah, that's true... I hadn't really thought about plugins. Cheers! EDIT: In fact, looking at the top of the page I encountered "eDriven.Gui"... which, judging by the example screenshots, is the kind of thing I might need. Awesome.
Your answer
Follow this Question
Related Questions
How to make disappear a GUI text after an amount of time? 5 Answers
String.Remove not working 1 Answer
Predict Text Width of String 0 Answers
Why is text ui cant be static ? 0 Answers
Text does not wrap properly 1 Answer