public override void Draw(GUIGraphicEngine guiGraphicEngine) { Rectangle rect = new Rectangle(new Point(0, 0), Size); guiGraphicEngine.DrawRectangle(rect, ButtonColor); Size textSize = guiGraphicEngine.GetTextSizePixels(text); Point textPosition = new Point(1, 1); if (textSize.Width < Size.Width) { textPosition.X = (Size.Width - textSize.Width) / 2; } if (textSize.Height < Size.Height) { textPosition.Y = Size.Height / 2 - textSize.Height + 3; } guiGraphicEngine.DrawText(textPosition, Text, TextColor); guiGraphicEngine.DrawRectangleFrame(rect, FrameColor, 1); if (Father.Focus == this) { guiGraphicEngine.DrawRectangleFrame(rect, Color.White, 1); } }
public override void Draw(GUIGraphicEngine guiGraphicEngine) { Rectangle rect = new Rectangle(new Point(0, 0), Size); if (BackColor.A > 0) { guiGraphicEngine.DrawRectangle(rect, BackColor); } Rectangle rectTexto = new Rectangle(24, 0, Size.Width - 24, Size.Height); guiGraphicEngine.DrawText(rectTexto, text, TextColor); if (chk) { guiGraphicEngine.DrawText(new Point(4, 0), "[X]"); } else { guiGraphicEngine.DrawText(new Point(4, 0), "[ ]"); } if (Father.Focus == this) { guiGraphicEngine.DrawRectangleFrame(rect, Color.White, 1); } }
public override void Draw(GUIGraphicEngine guiGraphicEngine) { Rectangle rect = new Rectangle(new Point(0, 0), Size); if (BackColor.A > 0) { guiGraphicEngine.DrawRectangle(rect, BackColor); } Rectangle rectTexto = new Rectangle(14, 0, Size.Width - 20, Size.Height); string text = ""; if (SelectedItem != null) { text = SelectedItem.ToString(); } guiGraphicEngine.DrawText(rectTexto, text, TextColor); guiGraphicEngine.DrawText(new Point(4, 0), "<"); guiGraphicEngine.DrawText(new Point(Size.Width - 10, 0), ">"); if (Father.Focus == this) { guiGraphicEngine.DrawRectangleFrame(rect, Color.White, 1); } }
public override void Draw(GUIGraphicEngine guiGraphicEngine) { Rectangle rect = new Rectangle(GUI_DIALOG_BORDER_SIZE, GUI_DIALOG_BORDER_SIZE, Size.Width - GUI_DIALOG_BORDER_SIZE * 2, GUI_DIALOG_TITLE_SIZE); //Dibujar titulo guiGraphicEngine.DrawRectangle(rect, TitleColor); int altoLetras = guiGraphicEngine.GetTextSizePixels("A").Height; guiGraphicEngine.DrawText(new Point(GUI_DIALOG_BORDER_SIZE + 4, GUI_DIALOG_TITLE_SIZE / 2 - altoLetras + 3 + GUI_DIALOG_BORDER_SIZE), title); //Dibujar cuerpo rect.Y += GUI_DIALOG_TITLE_SIZE - 1; rect.Height = Size.Height - rect.Y - GUI_DIALOG_BORDER_SIZE; guiGraphicEngine.DrawRectangle(rect, BackColor); rect.Location = new Point(0, 0); rect.Size = Size; guiGraphicEngine.DrawRectangleFrame(rect, FrameColor, GUI_DIALOG_BORDER_SIZE); }