Adding text to Console
Hi, I've got a host and a client that are connected over a network, I am trying to use a console on each machine to allow two people to 'chat', I've already stored, sent and received whatever is typed in on one machine to the other but I need to be able to enter the string into the textarea of the console, I used to be able to do this with an old version of QuickGUI but I'm unsure about how to do it with 9.03
Any help would be greatly appreciated.
Nothing has changed to the underlying mechanics of how text gets added to the text area portion of the console, but I did make some minor changes to the cursor positioning. I'll check this out tonight to see if something isn't working as expected. Pressing Enter should automatically add it to the TextArea, unless you have a InputHandler registered, in which case its up to the handler to decide if the text will get added or not.
Sorry, I didn't explain exactly what I'm trying to do properly, the text gets written to the text area of the console on the host machine that it's typed on when enter is pressed but I want to write the text to the text area on the client machine too. I'm sending the string over the network, I just need a way of adding it to the text area, I can't remember how I did it with the old QuickGUI, I hope that's clearer.
I just looked through my backup files and found that with QuickGUI 0.9.7 I used
Console::addText(const Ogre::UTFString& text)
Ah, I see. I seems like I don't have a function to do this! I will add some functions:
void addDisplayAreaText(Ogre::UTFString s, Ogre::FontPtr fp, const Ogre::ColourValue& cv);
void addDisplayAreaText(Ogre::UTFString s, const Ogre::String& fontName, const Ogre::ColourValue& cv);
void addDisplayAreaText(Ogre::UTFString s);
void addDisplayAreaText(std::vector<TextSegment> segments);
Do you think its necessary to be able to set the DisplayArea text?
Thank you, just being able to add text to the display area is all I need.
I added in the functionality I listed above, its in SVN. I will also release a zip at the beginning of next month. (~5 days) Also note there are some important changes with this upcoming release:
1. Using the DescManager class to get Desc objects
2. SheetManager has been removed, users can create/destroy Sheets when they want, name them what they want, and manage them how they want. (QuickGUI::Root does keep a simple list of created Sheets, to clean up any sheets that did not get destroyed manually by the user)