protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { if (progressMove > 0) { SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, Color.Black * 0.6f); } }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { var bottomrect = bounds.ToSubRectangleSouth(25); { // background SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Clouds); SimpleRenderHelper.DrawSimpleRect(sbatch, bottomrect, FlatColors.Concrete); } { // name FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 32, _meta?.LevelName ?? _level?.FullName, (_meta == null) ? FlatColors.Silver : FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5, bounds.Top + (bounds.Height - 25) / 2)); } { // user sbatch.DrawCentered(Textures.TexHUDIconGenericUser, new FPoint(bottomrect.Left + 5 + 32 + 5, bottomrect.CenterY), 20, 20, (_meta == null) ? FlatColors.Silver : FlatColors.WetAsphalt); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 20, (_meta == null) ? L10N.T(L10NImpl.STR_INF_YOU) : (_meta.Username ?? "Unknown"), (_meta == null) ? FlatColors.Silver : FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5 + 16, bounds.Bottom - 12.5f)); } if ((_meta != null) && _meta.GridSize != SCCMLevelData.SIZES[0]) // [XL] marker { var rr = bounds.ToSubRectangleSouthWest(32, 20); SimpleRenderHelper.DrawSimpleRect(sbatch, rr, FlatColors.Amethyst); FontRenderHelper.DrawSingleLineInBox(sbatch, Textures.HUDFontRegular, "XL", rr, 0, true, FlatColors.Foreground); } { // star counter var pointPos = new FPoint(bottomrect.Right - 100, bottomrect.CenterY); sbatch.DrawCentered(Textures.TexIconStar, pointPos, 20, 20, FlatColors.SunFlower); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 24, (_meta == null) ? "???" : _meta.Stars.ToString(), (_meta == null) ? FlatColors.Silver : FlatColors.MidnightBlue, pointPos + new Vector2(16, 0)); } SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black); }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Asbestos); SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black); if (ScrollMax > ScrollPageSize) { var yrange = Height - 64 - 64 - 32; var ypos = yrange * (ScrollPosition * 1f / (ScrollMax - ScrollPageSize)); SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByTopLeft(bounds.Left, bounds.Top + 64 + ypos, bounds.Width, 32), FlatColors.MidnightBlue); } }
protected override void OnDraw(IBatchRenderer sbatch) { SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), clickAreaThis.IsMouseDown() ? FlatColors.WetAsphalt : FlatColors.Asbestos); SimpleRenderHelper.DrawSimpleRectOutline(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), 2, FlatColors.MidnightBlue); SimpleRenderHelper.DrawRoundedRect(sbatch, FRectangle.CreateByCenter(Position, INNER_DIAMETER, INNER_DIAMETER), Color.Black); FontRenderHelper.DrawTextCenteredWithBackground( sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(L10NImpl.STR_GLOB_OVERWORLD), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH), FlatColors.BackgroundHUD2 * 0.5f); }
protected void DrawText(IBatchRenderer sbatch, FRectangle bounds, float leftOffset, float rightOffset) { var maxWidth = bounds.Width - leftOffset - rightOffset - CursorWidth - Font.Spacing; var dispText = Text; if (IsPassword) { if (_forceShowLastChar && dispText.Length > 0) { dispText = new string('*', dispText.Length - 1) + dispText[dispText.Length - 1]; } else { dispText = new string('*', dispText.Length); } } var textBounds = FontRenderHelper.MeasureStringCached(Font, dispText, FontSize); while (dispText.Length > 0 && textBounds.Width > maxWidth) { dispText = Text.Substring(1); textBounds = FontRenderHelper.MeasureStringCached(Font, dispText, FontSize); } FontRenderHelper.DrawTextVerticallyCentered( sbatch, Font, FontSize, dispText, ColorText, new FPoint(bounds.X + leftOffset, bounds.Y + bounds.Height / 2)); if (IsFocused && (int)(_cursorBlinkTimer / CURSOR_BLINK_TIME) % 2 == 0) { SimpleRenderHelper.DrawSimpleRect( sbatch, new FRectangle( bounds.X + leftOffset + textBounds.Width + Font.Spacing, bounds.Y + bounds.Height / 2 - FontSize / 2, CursorWidth, FontSize), ColorText); } }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { var bottomrect = bounds.ToSubRectangleSouth(25); SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Clouds); SimpleRenderHelper.DrawSimpleRect(sbatch, bottomrect, FlatColors.Concrete); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 32, _data.Name, FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5, bounds.Top + (bounds.Height - 25) / 2)); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 20, MainGame.Inst.Profile.OnlineUsername, FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5 + 16, bounds.Bottom - 12.5f)); sbatch.DrawCentered(Textures.TexHUDIconGenericUser, new FPoint(bottomrect.Left + 5 + 32 + 5, bottomrect.CenterY), 20, 20, FlatColors.WetAsphalt); if (_data.Size != SCCMLevelData.SIZES[0]) { var rr = bounds.ToSubRectangleSouthWest(32, 20); SimpleRenderHelper.DrawSimpleRect(sbatch, rr, FlatColors.Amethyst); FontRenderHelper.DrawSingleLineInBox(sbatch, Textures.HUDFontRegular, "XL", rr, 0, true, FlatColors.Foreground); } SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black); }
protected override void OnDraw(IBatchRenderer sbatch) { SimpleRenderHelper.DrawSimpleRect(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), clickAreaThis.IsMouseDown() ? FlatColors.WetAsphalt : FlatColors.Asbestos); SimpleRenderHelper.DrawSimpleRectOutline(sbatch, FRectangle.CreateByCenter(Position, DIAMETER, DIAMETER), 2, FlatColors.MidnightBlue); SimpleRenderHelper.DrawRoundedRect(sbatch, FRectangle.CreateByCenter(Position, INNER_DIAMETER, INNER_DIAMETER), NodeEnabled ? ColorMath.Blend(Color.Black, FlatColors.Background, ColorOverdraw) : FlatColors.Asbestos); FontRenderHelper.DrawTextCenteredWithBackground( sbatch, Textures.HUDFontBold, 0.9f * GDConstants.TILE_WIDTH, L10N.T(Levels.WORLD_NAMES[Target.ID]), FlatColors.TextHUD, Position + new Vector2(0, 2.25f * GDConstants.TILE_WIDTH), FlatColors.BackgroundHUD2 * 0.5f); if (!NodeEnabled) { var scale = 1 + FloatMath.Sin(Lifetime) * 0.05f; sbatch.DrawCentered(Textures.TexIconLock, Position, INNER_DIAMETER * scale, INNER_DIAMETER * scale, Color.Black); } }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { var bottomrect = bounds.ToSubRectangleSouth(25); { // background SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Clouds); SimpleRenderHelper.DrawSimpleRect(sbatch, bottomrect, FlatColors.Concrete); } { // difficulty var tex = (PersonalBest == null) ? Textures.TexDifficultyLineNone : FractionDifficultyHelper.GetIcon(PersonalBest.Value); var col = (PersonalBest == null) ? FlatColors.Silver : FractionDifficultyHelper.GetColor(PersonalBest.Value); sbatch.DrawCentered(tex, new FPoint(bounds.Left + 5 + 16, bounds.Top + (Height - 25 - 32) / 2 + 16), 32, 32, col); } { // name FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 32, _meta.LevelName, FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5, bounds.Top + (bounds.Height - 25) / 2)); } { // user sbatch.DrawCentered(Textures.TexHUDIconGenericUser, new FPoint(bottomrect.Left + 5 + 32 + 5, bottomrect.CenterY), 20, 20, FlatColors.WetAsphalt); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 20, _meta.Username ?? "Unknown", FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5 + 16, bounds.Bottom - 12.5f)); } if (_meta.GridSize != SCCMLevelData.SIZES[0]) // [XL] marker { var rr = bounds.ToSubRectangleSouthWest(32, 20); SimpleRenderHelper.DrawSimpleRect(sbatch, rr, FlatColors.Amethyst); FontRenderHelper.DrawSingleLineInBox(sbatch, Textures.HUDFontRegular, "XL", rr, 0, true, FlatColors.Foreground); } { // star counter var pointPos = new FPoint(bottomrect.Right - 100, bottomrect.CenterY); sbatch.DrawCentered(Textures.TexIconStar, pointPos, 20, 20, FlatColors.SunFlower); FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 24, _meta.Stars.ToString(), FlatColors.MidnightBlue, pointPos + new Vector2(16, 0)); } SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black); }
protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds) { SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Clouds); SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black); }