Example #1
0
        public override void Render(Graphics graphics)
        {
            if (!IsVisible)
            {
                return;
            }

            graphics.DrawBox(Bounds, Color.Black);
            graphics.DrawBox(new RectangleF(Bounds.X + 1, Bounds.Y + 1, Bounds.Width - 2, Bounds.Height - 2), Color.Gray);

            float colorSize = DesiredHeight - 2; // TODO move to settings
            var textPosition = new Vector2(Bounds.X + Bounds.Width / 2 - colorSize / 2, Bounds.Y + Bounds.Height / 2);
            // TODO textSize to Settings
            graphics.DrawText(name, 18, textPosition, Color.White, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
            var colorBox = new RectangleF(Bounds.Right - colorSize - 1, Bounds.Top + 1, colorSize, colorSize);
            graphics.DrawBox(colorBox, node.Value);
            graphics.DrawBox(new RectangleF(colorBox.X, colorBox.Y, 1, colorSize), Color.Black);
        }
Example #2
0
 public override void Render(Graphics graphics)
 {
     if (!IsVisible)
     {
         return;
     }
     Color color = node.Value ? Color.Gray : Color.Crimson;
     var textPosition = new Vector2(Bounds.X + Bounds.Width / 2, Bounds.Y + Bounds.Height / 2);
     if (key != null)
         graphics.DrawText(string.Concat("[",key,"]"), 11, Bounds.TopLeft.Translate(2, 2), Color.White);
     // TODO textSize to Settings
     graphics.DrawText(name, 20, textPosition, Color.White, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     graphics.DrawBox(Bounds, Color.Black);
     graphics.DrawBox(new RectangleF(Bounds.X + 1, Bounds.Y + 1, Bounds.Width - 2, Bounds.Height - 2), color);
     if (Children.Count > 0)
     {
         float width = (Bounds.Width - 2) * 0.05f;
         float height = (Bounds.Height - 2) / 2;
         var imgRect = new RectangleF(Bounds.X + Bounds.Width - 3 - width, Bounds.Y + 1 + height - height / 2, width, height);
         graphics.DrawImage("menu_submenu.png", imgRect);
     }
     Children.ForEach(x => x.Render(graphics));
 }
Example #3
0
 public override void Render(Graphics graphics)
 {
     // TODO move to settings
     Color boxColor = Color.Gray;
     boxColor.A = 100;
     graphics.DrawBox(new RectangleF(Bounds.X, Bounds.Y, DesiredWidth, DesiredHeight), boxColor);
     var position = new Vector2(Bounds.X + 25, Bounds.Y + 12);
     var textColor = new ColorBGRA(255, 255, 255, 200);
     graphics.DrawText("Menu", 17, position, textColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     Children.ForEach(x => x.Render(graphics));
 }
Example #4
0
 public override void Render(Graphics graphics)
 {
     // TODO move to settings
     Color boxColor = Color.Gray;
     boxColor.A = 100;
     graphics.DrawBox(new RectangleF(Bounds.X, Bounds.Y, DesiredWidth, DesiredHeight), boxColor);
     var textColor = new ColorBGRA(255, 255, 255, 200);
     graphics.DrawText("Menu [F12]", 15, Bounds.TopLeft.Translate(40, 12), textColor, FontDrawFlags.VerticalCenter | FontDrawFlags.Center);
     Children.ForEach(x => x.Render(graphics));
 }