Пример #1
0
 public EzGUI(float _x, float _y, string _title)
 {
     Main = new EzElement(ElementType.CATEGORY, "MAIN_CAT", true);
     x = _x;
     y = _y;
     title = _title;
 }
Пример #2
0
 public static void MouseClick(EzElement e)
 {
     foreach (EzElement element in e.In)
     {
         bool mouseIn = MouseIn(element.Position);
         if (element.Type == ElementType.CATEGORY)
         {
             if (mouseIn) element.isOpen = !element.isOpen;
             if (element.isOpen) MouseClick(element);
         }
         else if (mouseIn) element.isActive = !element.isActive;
     }
 }
Пример #3
0
 public void AddMainElement(EzElement en)
 {
     Main.In.Add(en);
 }
Пример #4
0
 public void DrawElement(EzElement element, int i, int incat)
 {
     byte alpha = 140;
     if (element.isActive || element.isOpen) alpha = 255;
     int xoffset = 5 * incat;
     int yoffset = 20;
     ColorBGRA color = new ColorBGRA(32, 52, 123, alpha);
     element.Position = new float[4] { x + xoffset, x + xoffset + 15, y + yoffset * i, y + yoffset * i + 13 };
     if (MouseIn(element.Position)) { color.R = 10; }
     switch (element.Type)
     {
         case ElementType.CATEGORY:
             _2DGeometry.DrawFilledBox(element.Position[0], element.Position[2], 15, 15, color);
             _2DGeometry.DrawShadowText("> "+element.Content, x + xoffset + 18, y + yoffset * i, new ColorBGRA(12, 0, 222, 255));
             break;
         case ElementType.CHECKBOX:
             _2DGeometry.DrawFilledBox(element.Position[0], element.Position[2], 15, 15, color);
             _2DGeometry.DrawShadowText(element.Content, x + xoffset + 18, element.Position[2], new ColorBGRA(12, 0, 222, 255));
             break;
         case ElementType.TEXT:
             _2DGeometry.DrawShadowText(element.Content, element.Position[0], element.Position[2], new ColorBGRA(12, 0, 222, 255));
             break;
     }
 }
Пример #5
0
 public void Count(EzElement elem, ref int i)
 {
     foreach (EzElement element in elem.In)
     {
         i++;
         if (element.Type == ElementType.CATEGORY && element.isOpen) Count(element, ref i);
     }
 }