Chat gui options - SFSIsland Demo

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

User avatar
JalenBlade
Posts: 14
Joined: 11 Jun 2009, 15:35

Chat gui options - SFSIsland Demo

Postby JalenBlade » 23 Jun 2009, 15:58

Is it possible to change the chat background color etc? I can't find the images used if they are images.
Is it possible to make the chat window moveable/sizable by the player? If so how?
Is there any code around that allows us to change the way chat works? I would like the player to click in the window to chat and be able to keep chatting until they click the game screen again. No enter/type/enter/type action. If so, a link would be appreciated.
I've spent an hour or more trying to size and move the chat screen to the Bottom/Left of the game screen using this code in the chatController script...
void Start() {
chatWindow = new Rect(Screen.width - 1235, Screen.height - 200, 1235, 200);
}
The first number seems to set the horizontal position of the screen rather than the width. The third number seems to adjust the actual width. the second number seems to position the window vertically and the 4th number seems to determine the actual height of the window...is that right?
Is there a way to make it 100% width? It seems like there must be an easier way to position it and make it work in all resolutions.

Any help with these questions would be greatly appreciated!
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Jun 2009, 16:56

Hi - yes to most of those questions.

But the real place to ask these things is over on the unity forums.

http://forum.unity3d.com/

None of the questions are really SFS API relevant, and you would have much higher visibility and success rate asking Unity questions over there :-)

What you do need to do though is to read up on the documentation provided for the GUI as well as check out the general GUI reference documentation. Sorry to say, but most people will most likely tell you to go read the documentation - so I'll do that too :-) Teach a man to fish...... etc

They are usually installed here on your machine:

file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/GUI%20Scripting%20Guide.html

For the graphics part of the island demo I've used a skin that is automagic used by all UI elements.

file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/class-GUISkin.html

;-)

/Thomas
User avatar
JalenBlade
Posts: 14
Joined: 11 Jun 2009, 15:35

Postby JalenBlade » 24 Jun 2009, 17:11

Thanks, yep, I found most of the answer to the GUI textures after posting but forgot to edit this post. I think I have the GUI side of things working, won't know til I get the server side extension figured out.

Moving, positioning and sizing the chat screen though? I thought SFS was in charge of the chat portion of this duo. Also, code that controls how chat is entered seems like SFS territory. No?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Jun 2009, 18:10

Thats all Unity GUI territory - SFS is only responsible for the transport of the chat text + broadcasting it on the server side.

All rendering is purely Unity

/Thomas
User avatar
JalenBlade
Posts: 14
Joined: 11 Jun 2009, 15:35

Postby JalenBlade » 24 Jun 2009, 19:41

cool, good info to know!

Thanks!

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 18 guests