Beispiel #1
0
 protected HUDItem(Window win, string name, HUDBase root, HUDItem parent, List <HUDItem> children)
 {
     Win       = win;
     Name      = name;
     Root      = root;
     Parent    = parent;
     _children = children;
 }
Beispiel #2
0
 public override void DoMouseDown(MouseButtonEventArgs bu)
 {
     _hovered = Over(Win.Mouse);
     foreach (HUDItem item in AllSubChildren)
     {
         item.DoMouseDown(bu);
     }
 }
Beispiel #3
0
 public HUDCameraController(string name, HUDItem parent) : base(name, parent)
 {
     coords = new HUDRect("coords", this)
     {
         Color    = Util.Color(30, 0, 0),
         mode     = AlignMode.rightAlign | AlignMode.bottomAlign,
         LocalPos = new vec2(1, -1)
     };
 }
Beispiel #4
0
 public HUDGeom(string name, HUDItem parent) : base(name, parent)
 {
     new HUDRect("test", this)
     {
         Text      = "TEST",
         Color     = Util.Color(100, 100, 100),
         mode      = AlignMode.leftAlign | AlignMode.topAlign,
         LocalPos  = new vec2(-1, 1),
         MouseDown = (self, args) => { if (self.Root.Hovered == self)
                                       {
                                           self.Text = self.Text + "1";
                                       }
         }
     };
 }
Beispiel #5
0
 public HUDItem Over(vec2 point)
 {
     foreach (HUDItem child in Children)
     {
         HUDItem found = child.Over(point);
         if (found != null)
         {
             return(found);
         }
     }
     if (Hitbox(point))
     {
         return(this);
     }
     return(null);
 }
Beispiel #6
0
 public EntityManager(HUDBase itemRoot)
 {
     item = new HUDItem("Entity Manager", itemRoot);
 }
Beispiel #7
0
 public HUDItem(string name, HUDItem parent) : this(parent.Win, name, parent.Root, parent, new List <HUDItem>())
 {
     Parent._children.Add(this);
 }
Beispiel #8
0
 public void UpdateHovered(vec2 pos)
 {
     _hovered = Over(pos);
 }
Beispiel #9
0
 public HUDDynamic(string name, HUDItem parent) : base(name, parent)
 {
 }
Beispiel #10
0
 public HUDRect(string name, HUDItem parent) : base(name, parent)
 {
 }