public virtual void DrawProgressBar(GuiRenderer renderer, ProgressBar progressBar) { renderer.FillRectangle(progressBar.BoundingBox, Color.Gray); var contentBounds = progressBar.ContentRectangle; contentBounds.Width = (int)(contentBounds.Width * progressBar.Value); DrawSelectionBox(renderer, contentBounds, SelectionStyle.ItemActive); }
public override void DrawCheckBox(GuiRenderer renderer, CheckBox checkBox, Rectangle bounds) { var color = (checkBox.CheckColor ?? StyleColor.Default).GetColor(Color.Gray); if (checkBox.IsHovered) { renderer.FillRectangle(bounds, color * 0.5f); } renderer.DrawRectangle(bounds, color, 2); if (checkBox.IsChecked) { bounds.X += 4; bounds.Y += 4; bounds.Width -= 8; bounds.Height -= 8; renderer.FillRectangle(bounds, color); } }
public override void DrawSelectionBox(GuiRenderer renderer, Rectangle bounds, SelectionStyle selectionStyle) { var color = _selectionColor; if (selectionStyle == SelectionStyle.ItemHover) { color *= 0.67f; } renderer.FillRectangle(bounds, color); }
public override void DrawButton(GuiRenderer renderer, IButtonElement button) { var styleColor = button.ButtonColor ?? StyleColor.Default; var color = styleColor.GetColor(button.IsActive ? _activeButtonColor : _buttonColor); if (button.IsPressed) { color = color.Darken(0.3f); } else if (button.IsHovered) { color = color.Lighten(0.2f); } var borderColor = color.Lighten(0.15f); renderer.FillRectangle(button.BoundingBox, color); renderer.DrawRectangle(button.BoundingBox, borderColor, 2); }
public override void DrawTextCursor(GuiRenderer renderer, Color color, Vector2 position, int height) { var rect = new Rectangle((int)position.X, (int)position.Y, TextCursorWidth, height); renderer.FillRectangle(rect, color); }
public override void DrawStringListBackground(GuiRenderer renderer, StringList stringList) { renderer.FillRectangle(stringList.BoundingBox, (stringList.BackColor ?? StyleColor.Default).GetColor(Color.White)); }
protected override void OnPaint(GameTime gameTime, GuiRenderer renderer) { renderer.FillRectangle(BoundingBox, BackColor); }