public GlobalChatClientGUI(Vector2 position, Vector2 containerSize, Vector2 chatBoxSize, int refreshTimeInMilliseconds, SpriteFont chatFont, Color containerColor, Color chatBoxColor, List<Texture2D> textureList)
{
this.chatFont = chatFont;
textures = textureList;
try
{
this.chatClient = new GlobalChatClient(this.ROOT_SERVER_URL);
isOnline = true;
ref_Counter = DateTime.Now;
this.chatLogs = this.chatClient.GetLogs();
}
catch (System.Net.WebException e)
{
isOnline = false;
}
//Check borders and make sure chatBox fits inside container
if (this.chatBoxSize.X > containerSize.X)
{
this.chatBoxSize.X = containerSize.X;
}
if (this.chatBoxSize.Y > containerSize.Y)
{
this.chatBoxSize.Y = containerSize.Y;
}
this.position = position;
this.borderSize = containerSize;
this.chatBoxSize = chatBoxSize;
this.chatBoxColor = chatBoxColor;
this.containerColor = containerColor;
this.ref_ms = refreshTimeInMilliseconds;
this.box_Margin = this.borderSize - this.chatBoxSize;
this.messageBuffer = new StringBuilder();
}