public void UpdateChats() { ChatScroller.RemoveAllChildren(); float by = 0; for (int i = 0; i < ChatMessages.Count; i++) { if (Channels[(int)ChatMessages[i].Channel]) { by += FontSets.Standard.font_default.Height; int y = (int)by; string ch = (ChatMessages[i].Channel == TextChannel.ALWAYS) ? "" : (ChatMessages[i].Channel.ToString() + ": "); ChatScroller.AddChild(new UILabel(ch + ChatMessages[i].Text, FontSets.Standard, UIAnchor.TOP_LEFT, () => 0, () => y, () => (int)ChatScroller.GetWidth())); } } by += FontSets.Standard.font_default.Height; ChatBottom = (int)(by - ChatScroller.GetHeight()); ChatScroller.MaxScroll = ChatBottom; }
public void UpdateChats() { ChatScroller.RemoveAllChildren(); float by = 0; for (int i = 0; i < ChatMessages.Count; i++) { if (Channels[(int)ChatMessages[i].Channel]) { by += FontSets.Standard.font_default.Height; int y = (int)by; ChatScroller.AddChild(new UILabel(ChatMessages[i].Channel.ToString() + ": " + ChatMessages[i].Text, FontSets.Standard, UIAnchor.TOP_LEFT, () => 0, () => y, () => (int)ChatScroller.GetWidth())); } } }