/// <summary> /// Render state /// </summary> /// <param name="time"><see cref="GameTime"/></param> public override void Render(GameTime time) { DH.RenderScene(Scene, () => { DH.Raw(_content.TEXUI_MenuBG, 32, 0); _buttons.ForEach(button => button.Display( )); }); }
/// <summary> /// Render console /// </summary> /// <param name="time"><see cref="GameTime"/></param> public override void Render(GameTime time) { if (!IsVisible) { return; } DH.RenderScene(Scene, color: COLOR.DarkestGray * .75f, logic: () => { DH.Box(0, (int)Height, (int)Width, 35, COLOR.DarkestGray, AlignType.LB); DH.Line(0, Height - 35, Width, Height - 35, color: COLOR.DarkGray); // Command input DH.Text(Font, $"Command: {Command}" + (_typeWall ? "|" : ""), new Vector2(10, Height - 10), false, COLOR.DarkGray, AlignType.LB); if (LOG.Logs.Count == 0) { return; } int row = 0; LOG.Logs.ForEach(log => { Color color = LOG.GetColor(log); // Display message if (!string.IsNullOrWhiteSpace(log.Message)) { foreach (string data in TEXT.GetDividedText(Font, $"[{log.CDate.ToLongTimeString( )}][{log.Type}]: {log.Message}", Width - 20, false)) { DH.Text(Font, data, new Vector2(10, 10 + (row++) * LineHeight), false, color); } } // Display exception if (log.Exception == null) { return; } string[] raw = TEXT.ExpandException(log.Exception); // Add time and type at the beginning raw[0] = raw[0].Insert(0, $"[{log.CDate.ToLongTimeString( )}][{log.Type}]: "); foreach (string data in raw) { foreach (string displayData in TEXT.GetDividedText(Font, data, Width - 20, false)) { DH.Text(Font, displayData, new Vector2(10, 10 + (row++) * LineHeight), false, color); } } }); }); }
public override void Display( ) { if (IsHover) { DH.Box((int)X, (int)Y, (int)Width, (int)Height, ColorsManager.DarkGray * .25f); } DH.Text( Font ?? _content.GetFont(IsHover ? FontType.Big : FontType.Standard), TextTranslate ? LANG.Get(Text).ToUpper( ) : Text.ToUpper( ), Center, false, TextColor, Align ); }
/// <summary> /// Render state /// </summary> /// <param name="time"><see cref="GameTime"/></param> public override void Render(GameTime time) { DH.RenderScene(Scene, () => { DH.Raw(_content.TEXUI_MenuBG, 32, 0); _buttons.ForEach(button => { if (button.IsHover) { DH.Box((int)button.X, (int)button.Y, (int)button.Width, (int)button.Height, ColorsManager.DarkGray * .25f); } button.Display( ); }); }); }