protected HUDItem(Window win, string name, HUDBase root, HUDItem parent, List <HUDItem> children) { Win = win; Name = name; Root = root; Parent = parent; _children = children; }
public override void DoMouseDown(MouseButtonEventArgs bu) { _hovered = Over(Win.Mouse); foreach (HUDItem item in AllSubChildren) { item.DoMouseDown(bu); } }
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) }; }
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"; } } }; }
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); }
public EntityManager(HUDBase itemRoot) { item = new HUDItem("Entity Manager", itemRoot); }
public HUDItem(string name, HUDItem parent) : this(parent.Win, name, parent.Root, parent, new List <HUDItem>()) { Parent._children.Add(this); }
public void UpdateHovered(vec2 pos) { _hovered = Over(pos); }
public HUDDynamic(string name, HUDItem parent) : base(name, parent) { }
public HUDRect(string name, HUDItem parent) : base(name, parent) { }